pub struct BoundedCell<T: Storable, M: Memory = DefaultMemoryImpl> { /* private fields */ }Expand description
A stable cell whose writes enforce the record’s declared Storable bound.
Implementations§
Source§impl<T: Storable, M: Memory> BoundedCell<T, M>
impl<T: Storable, M: Memory> BoundedCell<T, M>
Sourcepub fn init(memory: RuntimeMemory<M>, value: T) -> Self
pub fn init(memory: RuntimeMemory<M>, value: T) -> Self
Open a current cell or initialize a fresh bounded record. Empty memory or foreign magic initializes the supplied value, potentially overwriting foreign contents. Recognized incompatible layouts are refused.
§Panics
Panics for unbounded records or encodings that violate the declared bound.
Also retains StableCell::init layout, growth and codec/backing panics.
Auto Trait Implementations§
impl<T, M = Rc<RefCell<Vec<u8>>>> !Freeze for BoundedCell<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !RefUnwindSafe for BoundedCell<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !Send for BoundedCell<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !Sync for BoundedCell<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !UnwindSafe for BoundedCell<T, M>
impl<T, M> Unpin for BoundedCell<T, M>
impl<T, M> UnsafeUnpin for BoundedCell<T, M>
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