Struct apalis_core::worker::Addr
source · [−]pub struct Addr<A: Actor> { /* private fields */ }Available on crate feature
worker only.Expand description
Address of actor. Can be used to send messages to it.
Implementations
sourceimpl<W: Actor> Addr<W>
impl<W: Actor> Addr<W>
sourcepub async fn send<M>(&self, message: M) -> Result<M::Result, RecvError> where
M: Message + Send + 'static,
M::Result: Send,
W: ContextHandler<M>,
pub async fn send<M>(&self, message: M) -> Result<M::Result, RecvError> where
M: Message + Send + 'static,
M::Result: Send,
W: ContextHandler<M>,
sourcepub async fn do_send<M>(&self, message: M) -> Option<M::Result> where
M: Message + Send + 'static,
M::Result: Send,
W: ContextHandler<M>,
pub async fn do_send<M>(&self, message: M) -> Option<M::Result> where
M: Message + Send + 'static,
M::Result: Send,
W: ContextHandler<M>,
sourcepub fn recipient<M>(&self) -> Recipient<M> where
M: Message + Send + 'static,
W: ContextHandler<M>,
M::Result: Send,
pub fn recipient<M>(&self) -> Recipient<M> where
M: Message + Send + 'static,
W: ContextHandler<M>,
M::Result: Send,
Constructs recipient for sending only specific messages
sourcepub fn expect_running(self) -> AlwaysAddr<W>
pub fn expect_running(self) -> AlwaysAddr<W>
Contstructs address which will never panic on sending.
Beware: You need to make sure that this actor will be always alive
Trait Implementations
Auto Trait Implementations
impl<A> !RefUnwindSafe for Addr<A>
impl<A> Send for Addr<A>
impl<A> Sync for Addr<A>
impl<A> Unpin for Addr<A>
impl<A> !UnwindSafe for Addr<A>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more