Struct jormungandr::blockchain::candidate::chain_landing::State
source · pub struct State<S> {
blockchain: Blockchain,
header: Header,
stream: S,
}
Fields§
§blockchain: Blockchain
§header: Header
§stream: S
Implementations§
source§impl<S> State<S>where
S: Stream<Item = Header> + Unpin,
impl<S> State<S>where S: Stream<Item = Header> + Unpin,
pub async fn start(stream: S, blockchain: Blockchain) -> Result<Self, Error>
sourcepub async fn skip_present_blocks(self) -> Result<Option<(Header, S)>, Error>
pub async fn skip_present_blocks(self) -> Result<Option<(Header, S)>, Error>
Reads the stream and skips blocks that are already present in the storage. Resolves with the header of the first block that is not present, but its parent is in storage, and the stream with headers remaining to be read. If the stream ends before the requisite header is found, resolves with None. The chain also is pre-verified for sanity.
Auto Trait Implementations§
impl<S> !RefUnwindSafe for State<S>
impl<S> Send for State<S>where S: Send,
impl<S> Sync for State<S>where S: Sync,
impl<S> Unpin for State<S>where S: Unpin,
impl<S> !UnwindSafe for State<S>
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request