pub struct Mailbox<K: Span, P: Eq, S: Eq = ()> { /* private fields */ }Expand description
A way to send messages to the peer actor.
Trait Implementations§
Source§impl<K, P, S> Resolver for Mailbox<K, P, S>
impl<K, P, S> Resolver for Mailbox<K, P, S>
Source§fn fetch<D>(&mut self, key: D) -> Feedback
fn fetch<D>(&mut self, key: D) -> Feedback
Send a fetch to the peer actor.
If a fetch is already in progress for this key, this clears any existing targets for that key (the fetch will try any available peer).
If the engine has shut down, this is a no-op.
Source§fn fetch_all<D>(&mut self, keys: Vec<D>) -> Feedback
fn fetch_all<D>(&mut self, keys: Vec<D>) -> Feedback
Send fetches to the peer actor for a batch of keys.
If a fetch is already in progress for any key, this clears any existing targets for that key (the fetch will try any available peer).
If the engine has shut down, this is a no-op.
Source§fn retain(
&mut self,
predicate: impl Fn(&Self::Key, &Self::Subscriber) -> bool + Send + 'static,
) -> Feedback
fn retain( &mut self, predicate: impl Fn(&Self::Key, &Self::Subscriber) -> bool + Send + 'static, ) -> Feedback
Send a retain request to the peer actor.
If the engine has shut down, this is a no-op.
Source§type Subscriber = S
type Subscriber = S
Source§impl<K, P, S> TargetedResolver for Mailbox<K, P, S>
impl<K, P, S> TargetedResolver for Mailbox<K, P, S>
Source§fn fetch_targeted(
&mut self,
key: impl Into<Fetch<Self::Key, Self::Subscriber>> + Send,
targets: NonEmptyVec<Self::PublicKey>,
) -> Feedback
fn fetch_targeted( &mut self, key: impl Into<Fetch<Self::Key, Self::Subscriber>> + Send, targets: NonEmptyVec<Self::PublicKey>, ) -> Feedback
Send a targeted fetch to the peer actor.
If a fetch is already in progress for this key:
- If the existing fetch has targets, the new targets are added to the set.
- If the existing fetch has no targets, it remains unrestricted.
To clear targeting and fall back to any peer, call fetch.
Targets are automatically cleared when the fetch succeeds or is canceled. When a peer is blocked for invalid data, only that peer is removed from the target set.
If the engine has shut down, this is a no-op.
Source§fn fetch_all_targeted<D>(
&mut self,
keys: Vec<(D, NonEmptyVec<Self::PublicKey>)>,
) -> Feedback
fn fetch_all_targeted<D>( &mut self, keys: Vec<(D, NonEmptyVec<Self::PublicKey>)>, ) -> Feedback
Send targeted fetches to the peer actor for a batch of keys.
If the engine has shut down, this is a no-op.
Auto Trait Implementations§
impl<K, P, S> Freeze for Mailbox<K, P, S>
impl<K, P, S = ()> !RefUnwindSafe for Mailbox<K, P, S>
impl<K, P, S> Send for Mailbox<K, P, S>
impl<K, P, S> Sync for Mailbox<K, P, S>
impl<K, P, S> Unpin for Mailbox<K, P, S>
impl<K, P, S> UnsafeUnpin for Mailbox<K, P, S>
impl<K, P, S = ()> !UnwindSafe for Mailbox<K, P, 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
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>
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>
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