pub struct Log<'a, S, T> {
pub state: &'a mut LogState,
/* private fields */
}Expand description
A generic log parameterized by its storage type S and log entry type T.
Fields
state: &'a mut LogStateImplementations
sourceimpl<'a, S: StorageStack, T> Log<'a, S, T>
impl<'a, S: StorageStack, T> Log<'a, S, T>
sourcepub fn new(state: &'a mut LogState, storage: &'a mut S) -> Self
pub fn new(state: &'a mut LogState, storage: &'a mut S) -> Self
Return Log by initializing it with a LogState and a StorageStack.
sourcepub fn push(&mut self, entry: T) -> Option<()> where
T: ArgumentEncoder,
pub fn push(&mut self, entry: T) -> Option<()> where
T: ArgumentEncoder,
Add a new entry to the log.
Return None if the log is full, or storage is full.
sourcepub fn get(&self, index: u64) -> Option<T> where
T: for<'de> ArgumentDecoder<'de>,
pub fn get(&self, index: u64) -> Option<T> where
T: for<'de> ArgumentDecoder<'de>,
Look up a log entry by index.
Return None if the index is out of range, or it fails to read the entry.
Auto Trait Implementations
impl<'a, S, T> RefUnwindSafe for Log<'a, S, T> where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, S, T> Send for Log<'a, S, T> where
S: Send,
T: Send,
impl<'a, S, T> Sync for Log<'a, S, T> where
S: Sync,
T: Sync,
impl<'a, S, T> Unpin for Log<'a, S, T> where
T: Unpin,
impl<'a, S, T> !UnwindSafe for Log<'a, S, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more