pub struct RactorActorRef<A: Actor> { /* private fields */ }Expand description
A dactor ActorRef backed by a ractor ActorRef.
Messages are delivered through ractor’s mailbox as type-erased dispatch
envelopes, enabling multiple Handler<M> impls per actor.
When configured with MailboxConfig::Bounded, a bounded mpsc channel
sits in front of the ractor actor, providing backpressure control at the
dactor level while ractor’s internal mailbox remains unbounded.
Trait Implementations§
Source§impl<A: Actor + 'static> ActorRef<A> for RactorActorRef<A>
impl<A: Actor + 'static> ActorRef<A> for RactorActorRef<A>
Source§fn pending_messages(&self) -> usize
fn pending_messages(&self) -> usize
Approximate number of messages pending in the actor’s mailbox. Read more
Source§fn tell<M>(&self, msg: M) -> Result<(), ActorSendError>
fn tell<M>(&self, msg: M) -> Result<(), ActorSendError>
Fire-and-forget: deliver a message to the actor.
The message must have
Reply = () (no reply expected).Source§fn ask<M>(
&self,
msg: M,
cancel: Option<CancellationToken>,
) -> Result<AskReply<M::Reply>, ActorSendError>
fn ask<M>( &self, msg: M, cancel: Option<CancellationToken>, ) -> Result<AskReply<M::Reply>, ActorSendError>
Request-reply: send a message and await the reply. Read more
Source§fn expand<M, OutputItem>(
&self,
msg: M,
buffer: usize,
batch_config: Option<BatchConfig>,
cancel: Option<CancellationToken>,
) -> Result<BoxStream<OutputItem>, ActorSendError>
fn expand<M, OutputItem>( &self, msg: M, buffer: usize, batch_config: Option<BatchConfig>, cancel: Option<CancellationToken>, ) -> Result<BoxStream<OutputItem>, ActorSendError>
Request-stream: send a request and receive a stream of responses.
buffer controls the channel capacity (backpressure). Read moreSource§fn reduce<InputItem, Reply>(
&self,
input: BoxStream<InputItem>,
buffer: usize,
batch_config: Option<BatchConfig>,
cancel: Option<CancellationToken>,
) -> Result<AskReply<Reply>, ActorSendError>
fn reduce<InputItem, Reply>( &self, input: BoxStream<InputItem>, buffer: usize, batch_config: Option<BatchConfig>, cancel: Option<CancellationToken>, ) -> Result<AskReply<Reply>, ActorSendError>
Client-streaming (feed): stream items to the actor and receive a reply. Read more
Source§fn transform<InputItem, OutputItem>(
&self,
input: BoxStream<InputItem>,
buffer: usize,
batch_config: Option<BatchConfig>,
cancel: Option<CancellationToken>,
) -> Result<BoxStream<OutputItem>, ActorSendError>where
A: TransformHandler<InputItem, OutputItem>,
InputItem: Send + 'static,
OutputItem: Send + 'static,
fn transform<InputItem, OutputItem>(
&self,
input: BoxStream<InputItem>,
buffer: usize,
batch_config: Option<BatchConfig>,
cancel: Option<CancellationToken>,
) -> Result<BoxStream<OutputItem>, ActorSendError>where
A: TransformHandler<InputItem, OutputItem>,
InputItem: Send + 'static,
OutputItem: Send + 'static,
Transform: stream items to the actor and receive a stream of outputs. Read more
Source§impl<A: Actor> Clone for RactorActorRef<A>
impl<A: Actor> Clone for RactorActorRef<A>
Auto Trait Implementations§
impl<A> Freeze for RactorActorRef<A>
impl<A> !RefUnwindSafe for RactorActorRef<A>
impl<A> Send for RactorActorRef<A>
impl<A> Sync for RactorActorRef<A>
impl<A> Unpin for RactorActorRef<A>
impl<A> UnsafeUnpin for RactorActorRef<A>
impl<A> !UnwindSafe for RactorActorRef<A>
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> 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> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage