pub struct RawKeyBuilder<const N: usize> { /* private fields */ }Expand description
Fixed-capacity stack key builder for RawStorage keys.
This keeps contract samples on a heap-free path while centralizing the
small copy_nonoverlapping block that fixed key construction needs.
Push methods return false when the requested write would exceed capacity;
existing bytes are left unchanged in that case.
Implementations§
Source§impl<const N: usize> RawKeyBuilder<N>
impl<const N: usize> RawKeyBuilder<N>
pub const fn new() -> Self
pub fn push_bytes(&mut self, bytes: &[u8]) -> bool
pub fn push_i64_le(&mut self, value: i64) -> bool
pub fn push_byte(&mut self, value: u8) -> bool
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn clear(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for RawKeyBuilder<N>
impl<const N: usize> RefUnwindSafe for RawKeyBuilder<N>
impl<const N: usize> Send for RawKeyBuilder<N>
impl<const N: usize> Sync for RawKeyBuilder<N>
impl<const N: usize> Unpin for RawKeyBuilder<N>
impl<const N: usize> UnsafeUnpin for RawKeyBuilder<N>
impl<const N: usize> UnwindSafe for RawKeyBuilder<N>
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