pub struct StableLog<T: Storable, M: Memory = DefaultMemoryImpl> { /* private fields */ }Expand description
Governed upstream Log; initialization and failures follow upstream contracts.
Implementations§
Source§impl<T: Storable, M: Memory> StableLog<T, M>
impl<T: Storable, M: Memory> StableLog<T, M>
Sourcepub fn new(
index_memory: RuntimeMemory<M>,
data_memory: RuntimeMemory<M>,
) -> Self
pub fn new( index_memory: RuntimeMemory<M>, data_memory: RuntimeMemory<M>, ) -> Self
Delegates to upstream Log::new with the governed allocation.
Sourcepub fn init(
index_memory: RuntimeMemory<M>,
data_memory: RuntimeMemory<M>,
) -> Self
pub fn init( index_memory: RuntimeMemory<M>, data_memory: RuntimeMemory<M>, ) -> Self
Delegates to upstream Log::init with the governed allocation.
Sourcepub fn first(&self) -> Option<T>
pub fn first(&self) -> Option<T>
Delegates to upstream Log::first with the governed allocation.
Sourcepub fn get(&self, idx: u64) -> Option<T>
pub fn get(&self, idx: u64) -> Option<T>
Delegates to upstream Log::get with the governed allocation.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Delegates to upstream Log::is_empty with the governed allocation.
Trait Implementations§
Auto Trait Implementations§
impl<T, M = Rc<RefCell<Vec<u8>>>> !Freeze for StableLog<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !RefUnwindSafe for StableLog<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !Send for StableLog<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !Sync for StableLog<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !UnwindSafe for StableLog<T, M>
impl<T, M> Unpin for StableLog<T, M>
impl<T, M> UnsafeUnpin for StableLog<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