MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / get_attr

Method get_attr

wasm-pdk/src/lib.rs:466–478  ·  view source on GitHub ↗

`recv. `, read attribute or bind builtin method.

(&self, name: &str)

Source from the content-addressed store, hash-verified

464
465 /// `recv.<name>`, read attribute or bind builtin method.
466 pub fn get_attr(&self, name: &str) -> Result<Handle> {
467 let mut out: u32 = 0;
468 let r = unsafe {
469 edge_op(
470 op::GET_ATTR, self.raw,
471 name.as_ptr(), name.len() as u32,
472 core::ptr::null(), 0,
473 &mut out as *mut u32,
474 )
475 };
476 if r != 0 { return Err(last_error()); }
477 Ok(Handle::from_raw(out))
478 }
479
480 /// `recv[key]`; key passed as handle (encode an int for list indexing, str for dict lookup).
481 pub fn get_item(&self, key: &Handle) -> Result<Handle> {

Callers

nothing calls this directly

Calls 2

last_errorFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected