pub struct Mailbox<K, P> { /* private fields */ }Expand description
A way to send messages to the peer actor.
Trait Implementations§
Source§impl<K: Span, P: PublicKey> Resolver for Mailbox<K, P>
impl<K: Span, P: PublicKey> Resolver for Mailbox<K, P>
Source§async fn fetch(&mut self, key: Self::Key)
async fn fetch(&mut self, key: Self::Key)
Send a fetch request 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§async fn fetch_all(&mut self, keys: Vec<Self::Key>)
async fn fetch_all(&mut self, keys: Vec<Self::Key>)
Send a fetch request 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§async fn fetch_targeted(
&mut self,
key: Self::Key,
targets: NonEmptyVec<Self::PublicKey>,
)
async fn fetch_targeted( &mut self, key: Self::Key, targets: NonEmptyVec<Self::PublicKey>, )
Send a targeted fetch request to the peer actor.
If the engine has shut down, this is a no-op.
Source§async fn fetch_all_targeted(
&mut self,
requests: Vec<(Self::Key, NonEmptyVec<Self::PublicKey>)>,
)
async fn fetch_all_targeted( &mut self, requests: Vec<(Self::Key, NonEmptyVec<Self::PublicKey>)>, )
Send targeted fetch requests to the peer actor for a batch of keys.
If the engine has shut down, this is a no-op.
Source§async fn cancel(&mut self, key: Self::Key)
async fn cancel(&mut self, key: Self::Key)
Send a cancel request to the peer actor.
If the engine has shut down, this is a no-op.
Source§async fn retain(
&mut self,
predicate: impl Fn(&Self::Key) -> bool + Send + 'static,
)
async fn retain( &mut self, predicate: impl Fn(&Self::Key) -> bool + Send + 'static, )
Send a retain request to the peer actor.
If the engine has shut down, this is a no-op.
Auto Trait Implementations§
impl<K, P> Freeze for Mailbox<K, P>
impl<K, P> !RefUnwindSafe for Mailbox<K, P>
impl<K, P> Send for Mailbox<K, P>
impl<K, P> Sync for Mailbox<K, P>
impl<K, P> Unpin for Mailbox<K, P>
impl<K, P> !UnwindSafe for Mailbox<K, 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
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