pub struct Mailbox<B, C, H, P>{ /* private fields */ }Expand description
A mailbox for sending messages to the Engine.
Implementations§
Source§impl<B, C, H, P> Mailbox<B, C, H, P>
impl<B, C, H, P> Mailbox<B, C, H, P>
Sourcepub const fn new(sender: Sender<Message<B, C, H, P>>) -> Self
pub const fn new(sender: Sender<Message<B, C, H, P>>) -> Self
Create a new Mailbox with the given sender.
Sourcepub async fn proposed(&self, round: Round, block: CodedBlock<B, C, H>)
pub async fn proposed(&self, round: Round, block: CodedBlock<B, C, H>)
Broadcast a proposed erasure coded block’s shards to the participants.
Sourcepub async fn discovered(&self, commitment: Commitment, leader: P, round: Round)
pub async fn discovered(&self, commitment: Commitment, leader: P, round: Round)
Inform the engine of an externally proposed Commitment.
Sourcepub async fn get(
&self,
commitment: Commitment,
) -> Option<Arc<CodedBlock<B, C, H>>>
pub async fn get( &self, commitment: Commitment, ) -> Option<Arc<CodedBlock<B, C, H>>>
Request a reconstructed block by its Commitment.
Sourcepub async fn get_by_digest(
&self,
digest: B::Digest,
) -> Option<Arc<CodedBlock<B, C, H>>>
pub async fn get_by_digest( &self, digest: B::Digest, ) -> Option<Arc<CodedBlock<B, C, H>>>
Request a reconstructed block by its digest.
Sourcepub async fn subscribe_shard(&self, commitment: Commitment) -> Receiver<()>
pub async fn subscribe_shard(&self, commitment: Commitment) -> Receiver<()>
Subscribe to the receipt of our valid shard from the leader.
Sourcepub async fn subscribe(
&self,
commitment: Commitment,
) -> Receiver<Arc<CodedBlock<B, C, H>>>
pub async fn subscribe( &self, commitment: Commitment, ) -> Receiver<Arc<CodedBlock<B, C, H>>>
Subscribe to the reconstruction of a CodedBlock by its Commitment.
Sourcepub async fn subscribe_by_digest(
&self,
digest: B::Digest,
) -> Receiver<Arc<CodedBlock<B, C, H>>>
pub async fn subscribe_by_digest( &self, digest: B::Digest, ) -> Receiver<Arc<CodedBlock<B, C, H>>>
Subscribe to the reconstruction of a CodedBlock by its digest.
Sourcepub async fn prune(&self, through: Commitment)
pub async fn prune(&self, through: Commitment)
Request to prune all caches at and below the given commitment.
Trait Implementations§
Source§impl<B, C, H, P> Buffer<Coding<B, C, H, P>> for Mailbox<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>>,
C: CodingScheme,
H: Hasher,
P: PublicKey,
impl<B, C, H, P> Buffer<Coding<B, C, H, P>> for Mailbox<B, C, H, P>where
B: CertifiableBlock<Context = Context<Commitment, P>>,
C: CodingScheme,
H: Hasher,
P: PublicKey,
Source§type CachedBlock = Arc<CodedBlock<B, C, H>>
type CachedBlock = Arc<CodedBlock<B, C, H>>
The cached block type held internally by the buffer. Read more
Source§async fn find_by_digest(
&self,
digest: <CodedBlock<B, C, H> as Digestible>::Digest,
) -> Option<Self::CachedBlock>
async fn find_by_digest( &self, digest: <CodedBlock<B, C, H> as Digestible>::Digest, ) -> Option<Self::CachedBlock>
Attempt to find a block by its digest. Read more
Source§async fn find_by_commitment(
&self,
commitment: Commitment,
) -> Option<Self::CachedBlock>
async fn find_by_commitment( &self, commitment: Commitment, ) -> Option<Self::CachedBlock>
Attempt to find a block by its commitment. Read more
Source§async fn subscribe_by_digest(
&self,
digest: <CodedBlock<B, C, H> as Digestible>::Digest,
) -> Receiver<Self::CachedBlock>
async fn subscribe_by_digest( &self, digest: <CodedBlock<B, C, H> as Digestible>::Digest, ) -> Receiver<Self::CachedBlock>
Subscribe to a block’s availability by its digest. Read more
Source§async fn subscribe_by_commitment(
&self,
commitment: Commitment,
) -> Receiver<Self::CachedBlock>
async fn subscribe_by_commitment( &self, commitment: Commitment, ) -> Receiver<Self::CachedBlock>
Subscribe to a block’s availability by its commitment. Read more
Source§async fn finalized(&self, commitment: Commitment)
async fn finalized(&self, commitment: Commitment)
Notify the buffer that a block has been finalized. Read more
Auto Trait Implementations§
impl<B, C, H, P> Freeze for Mailbox<B, C, H, P>
impl<B, C, H, P> RefUnwindSafe for Mailbox<B, C, H, P>
impl<B, C, H, P> Send for Mailbox<B, C, H, P>
impl<B, C, H, P> Sync for Mailbox<B, C, H, P>
impl<B, C, H, P> Unpin for Mailbox<B, C, H, P>
impl<B, C, H, P> UnsafeUnpin for Mailbox<B, C, H, P>
impl<B, C, H, P> UnwindSafe for Mailbox<B, C, H, P>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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<B> IntoBlock<B> for B
impl<B> IntoBlock<B> for B
Source§fn into_block(self) -> B
fn into_block(self) -> B
Convert this cached block into the underlying block type.
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