pub struct Slot(pub [u8; 32]);Expand description
A 32-byte storage slot identifier.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl Slot
impl Slot
Sourcepub fn from_label(label: &str) -> Self
pub fn from_label(label: &str) -> Self
Creates a slot from a string label.
Sourcepub fn derived(namespace: &[u8; 32], parts: &[&[u8]]) -> Self
pub fn derived(namespace: &[u8; 32], parts: &[&[u8]]) -> Self
Creates a derived slot from a namespace and parts.
Sourcepub fn write_typed<T: Codec32>(self, value: &T) -> Result<()>
pub fn write_typed<T: Codec32>(self, value: &T) -> Result<()>
Writes a typed value implementing Codec32.
Sourcepub fn read_typed<T: Codec32>(self) -> Result<T>
pub fn read_typed<T: Codec32>(self) -> Result<T>
Reads a typed value implementing Codec32.
Sourcepub fn write_u128(self, value: u128) -> Result<()>
pub fn write_u128(self, value: u128) -> Result<()>
Writes a u128 value (little-endian).
Trait Implementations§
impl Copy for Slot
impl Eq for Slot
impl StructuralPartialEq for Slot
Auto Trait Implementations§
impl Freeze for Slot
impl RefUnwindSafe for Slot
impl Send for Slot
impl Sync for Slot
impl Unpin for Slot
impl UnsafeUnpin for Slot
impl UnwindSafe for Slot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more