Trait SystemFieldApi

Source
pub trait SystemFieldApi<E>
where E: Debug,
{ // Required methods fn field_read(&mut self, handle: u32) -> Result<Vec<u8>, E>; fn field_write(&mut self, handle: u32, buffer: Vec<u8>) -> Result<(), E>; fn field_lock(&mut self, handle: u32) -> Result<(), E>; fn field_close(&mut self, handle: u32) -> Result<(), E>; // Provided methods fn field_read_typed<S>(&mut self, handle: u32) -> Result<S, E> where S: ScryptoDecode { ... } fn field_write_typed<S>( &mut self, handle: u32, substate: &S, ) -> Result<(), E> where S: ScryptoEncode { ... } }
Expand description

System api to read/write fields

Required Methods§

Source

fn field_read(&mut self, handle: u32) -> Result<Vec<u8>, E>

Retrieve the value of a field

Source

fn field_write(&mut self, handle: u32, buffer: Vec<u8>) -> Result<(), E>

Write a value to a field

Source

fn field_lock(&mut self, handle: u32) -> Result<(), E>

Lock a field such that it becomes immutable

Source

fn field_close(&mut self, handle: u32) -> Result<(), E>

Close a field handle so that it is no longer usable

Provided Methods§

Source

fn field_read_typed<S>(&mut self, handle: u32) -> Result<S, E>
where S: ScryptoDecode,

Retrieve the value of a field

Source

fn field_write_typed<S>(&mut self, handle: u32, substate: &S) -> Result<(), E>
where S: ScryptoEncode,

Write a value to a field

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§