StorableInTable

Trait StorableInTable 

Source
pub trait StorableInTable: Sized {
    // Required methods
    fn unwrap_self(
        storage: &TableStorage,
        index: u32,
    ) -> Result<Self, TableAccessError>;
    fn wrap_self(
        self,
        storage: &mut TableStorage,
        index: u32,
    ) -> Result<(), TableAccessError>;
}
Expand description

Trait indicates types that can be stored in tables

Required Methods§

Source

fn unwrap_self( storage: &TableStorage, index: u32, ) -> Result<Self, TableAccessError>

Attempt to lookup self in the given table.

Source

fn wrap_self( self, storage: &mut TableStorage, index: u32, ) -> Result<(), TableAccessError>

Wrap value to be stored in a table.

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§

Source§

impl<'a> StorableInTable for Element<'a>

Source§

impl<'a, F: Into<Anyfunc<'a>> + TryFrom<Anyfunc<'a>>> StorableInTable for F