pub struct Sender<P: PublicKey, E: Clock> { /* private fields */ }Expand description
Implementation of a crate::Sender for the simulated network.
Also implements crate::LimitedSender to support rate-limit checking before sending messages.
Implementations§
Source§impl<P: PublicKey, E: Clock> Sender<P, E>
impl<P: PublicKey, E: Clock> Sender<P, E>
Sourcepub fn split_with<F: SplitForwarder<P>>(
self,
forwarder: F,
) -> (SplitSender<P, E, F>, SplitSender<P, E, F>)
pub fn split_with<F: SplitForwarder<P>>( self, forwarder: F, ) -> (SplitSender<P, E, F>, SplitSender<P, E, F>)
Split this Sender into a SplitOrigin::Primary and SplitOrigin::Secondary sender.
Trait Implementations§
Source§impl<P: PublicKey, E: Clock> LimitedSender for Sender<P, E>
impl<P: PublicKey, E: Clock> LimitedSender for Sender<P, E>
Source§type Checked<'a> = CheckedSender<'a, UnlimitedSender<P>>
where
Self: 'a
type Checked<'a> = CheckedSender<'a, UnlimitedSender<P>> where Self: 'a
The type of
CheckedSender returned after checking recipients.Source§async fn check(
&mut self,
recipients: Recipients<Self::PublicKey>,
) -> Result<Self::Checked<'_>, SystemTime>
async fn check( &mut self, recipients: Recipients<Self::PublicKey>, ) -> Result<Self::Checked<'_>, SystemTime>
Checks which recipients are within their rate limit and returns a
CheckedSender for sending to them. Read moreAuto Trait Implementations§
impl<P, E> Freeze for Sender<P, E>where
P: Freeze,
impl<P, E> !RefUnwindSafe for Sender<P, E>
impl<P, E> Send for Sender<P, E>
impl<P, E> Sync for Sender<P, E>
impl<P, E> Unpin for Sender<P, E>where
P: Unpin,
impl<P, E> !UnwindSafe for Sender<P, E>
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<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