pub struct EngineHandle<CS, PS>where
CS: ChainStore,
PS: PendingStore,{ /* private fields */ }Expand description
Handle ot the Engine, allowing communication with the engine. The engine itself is owned by a future executor.
Implementations§
Source§impl<CS, PS> EngineHandle<CS, PS>where
CS: ChainStore,
PS: PendingStore,
impl<CS, PS> EngineHandle<CS, PS>where
CS: ChainStore,
PS: PendingStore,
pub fn on_started(&self) -> impl Future<Output = ()>
pub fn write_entry_operation( &self, data: &[u8], ) -> Result<OperationId, EngineError>
pub fn get_chain_segments(&self) -> Result<Segments, EngineError>
pub fn get_chain_operation( &self, block_offset: BlockOffset, operation_id: OperationId, ) -> Result<Option<EngineOperation>, EngineError>
pub fn get_chain_operations( &self, from_offset: Option<BlockOffset>, ) -> ChainOperationsIterator<CS, PS>
pub fn get_chain_last_block_info( &self, ) -> Result<Option<(BlockOffset, BlockHeight)>, EngineError>
pub fn get_chain_block_info( &self, offset: BlockOffset, ) -> Result<Option<(BlockOffset, BlockHeight)>, EngineError>
pub fn get_chain_block( &self, offset: BlockOffset, ) -> Result<Option<DataBlock<ChainData>>, EngineError>
pub fn get_pending_operation( &self, operation_id: OperationId, ) -> Result<Option<EngineOperation>, EngineError>
pub fn get_pending_operations<R: RangeBounds<OperationId>>( &self, operations_range: R, ) -> Result<Vec<EngineOperation>, EngineError>
pub fn get_operation( &self, operation_id: OperationId, ) -> Result<Option<EngineOperation>, EngineError>
Sourcepub fn take_events_stream(
&mut self,
) -> Result<impl Stream<Item = Event>, EngineError>
pub fn take_events_stream( &mut self, ) -> Result<impl Stream<Item = Event>, EngineError>
Take the events stream receiver out of this Handle.
This stream is bounded and consumptions should be non-blocking to
prevent losing events. Calling the engine on every call should be
throttled in the case of a big read amplification.
Trait Implementations§
Source§impl<CS, PS> Clone for EngineHandle<CS, PS>where
CS: ChainStore,
PS: PendingStore,
impl<CS, PS> Clone for EngineHandle<CS, PS>where
CS: ChainStore,
PS: PendingStore,
Source§impl<CS, PS> Drop for EngineHandle<CS, PS>where
CS: ChainStore,
PS: PendingStore,
impl<CS, PS> Drop for EngineHandle<CS, PS>where
CS: ChainStore,
PS: PendingStore,
Auto Trait Implementations§
impl<CS, PS> Freeze for EngineHandle<CS, PS>
impl<CS, PS> !RefUnwindSafe for EngineHandle<CS, PS>
impl<CS, PS> Send for EngineHandle<CS, PS>
impl<CS, PS> Sync for EngineHandle<CS, PS>
impl<CS, PS> Unpin for EngineHandle<CS, PS>
impl<CS, PS> !UnwindSafe for EngineHandle<CS, PS>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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