pub struct MemoryPendingStore { /* private fields */ }Expand description
In memory pending store
Implementations§
Source§impl MemoryPendingStore
impl MemoryPendingStore
pub fn new() -> MemoryPendingStore
Trait Implementations§
Source§impl Default for MemoryPendingStore
impl Default for MemoryPendingStore
Source§impl PendingStore for MemoryPendingStore
impl PendingStore for MemoryPendingStore
Source§fn put_operation(&mut self, operation: NewOperation) -> Result<bool, Error>
fn put_operation(&mut self, operation: NewOperation) -> Result<bool, Error>
Adds or replaces the given operation into the store.
Returns true if the operation already exists and got overwritten.
Source§fn update_operation_commit_status(
&mut self,
operation_id: u64,
status: CommitStatus,
) -> Result<(), Error>
fn update_operation_commit_status( &mut self, operation_id: u64, status: CommitStatus, ) -> Result<(), Error>
Updates the commit status of an operation. This information is not
replicated, and is populated by the
CommitManager so that the
PendingSynchronizer and Engine can get the chain status of an
operation without hitting the chain every time.
Returns Error::NotFound if operation doesn’t exist.Source§fn get_operation(
&self,
operation_id: OperationId,
) -> Result<Option<StoredOperation>, Error>
fn get_operation( &self, operation_id: OperationId, ) -> Result<Option<StoredOperation>, Error>
Returns the operation with given id.
Source§fn get_group_operations(
&self,
group_id: GroupId,
) -> Result<Option<StoredOperationsGroup>, Error>
fn get_group_operations( &self, group_id: GroupId, ) -> Result<Option<StoredOperationsGroup>, Error>
Returns all operations grouped under the given group id / operation id.
An example of operation group is a block with its signatures /
refusals operations. Entry operations are NOT stored in the block’s
group since they could get added into different blocks (but only one
will be committed).
Source§fn operations_iter<R>(&self, range: R) -> Result<TimelineIterator<'_>, Error>where
R: RangeBounds<OperationId>,
fn operations_iter<R>(&self, range: R) -> Result<TimelineIterator<'_>, Error>where
R: RangeBounds<OperationId>,
Iterates through all operations in the store within the given range.
The iterator returns operations sorted by operation ids.
Source§fn operations_count(&self) -> usize
fn operations_count(&self) -> usize
Returns the number of operations in the store.
Source§fn delete_operation(&mut self, operation_id: OperationId) -> Result<(), Error>
fn delete_operation(&mut self, operation_id: OperationId) -> Result<(), Error>
Deletes the operation with given id, or all operations grouped by this
operation id if the operation was a group (ex: block with its
signatures)
Auto Trait Implementations§
impl Freeze for MemoryPendingStore
impl RefUnwindSafe for MemoryPendingStore
impl Send for MemoryPendingStore
impl Sync for MemoryPendingStore
impl Unpin for MemoryPendingStore
impl UnwindSafe for MemoryPendingStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more