Attribute Macro nandoize::nandoize_lib
source · #[nandoize_lib]Expand description
Attribute macro used to generate a nanotransaction out of the given function, and update the associated library’s dispatch function..
This macro generates the _nando variants of annotated functions, similar to nandoize.
Unlike nandoize, the generated nanotransactions are expanded in the target library’s
top-level namespace (as opposed to being added to NandoManager). Invocation of a target
function is then only a matter of calling the output library’s resolve_function with the
right nanotransaction name.
Should be used in conjunction with the PersistableDeriveLib macro to derive structs that can be
persisted in an Object.
Examples
#[derive(PersistableDerive)]
struct TestStruct {
x: u32,
y: i32,
}
#[nandoize_lib]
pub fn read_x(ts: &TestStruct) -> u32 {
ts.x
}