Skip to main content

RawStorage

Trait RawStorage 

Source
pub trait RawStorage: Sized {
    type Value;

    // Required methods
    fn as_raw(&self) -> Self::Value;
    fn from_raw(raw: Self::Value) -> Self;
}
Expand description

Trait implemented for storage which can be easily converted to and from a raw value.

This is implemented for SetStorage when the #[key(bitset)] attribute is present.

Required Associated Types§

Source

type Value

The backing raw value.

Required Methods§

Source

fn as_raw(&self) -> Self::Value

Get the raw value of the storage.

Source

fn from_raw(raw: Self::Value) -> Self

Build storage from raw storage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§