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§
Sourcefn unwrap_self(
storage: &TableStorage,
index: u32,
) -> Result<Self, TableAccessError>
fn unwrap_self( storage: &TableStorage, index: u32, ) -> Result<Self, TableAccessError>
Attempt to lookup self in the given table.
Sourcefn wrap_self(
self,
storage: &mut TableStorage,
index: u32,
) -> Result<(), TableAccessError>
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.