Skip to main content

ActorError

Enum ActorError 

Source
pub enum ActorError {
    OneshotRecv(RecvError),
    ChannelSend(String),
    ChannelRecv,
    Timeout(Duration),
    AddressRegexError(Error),
    AddressAlreadyExist(String),
    AddressNotFound(String),
    ActorNotReady(String),
    CloneFailed(String),
    UnhealthyActorSystem,
    MessageTypeMismatch,
}
Expand description

All errors surfaced by the actor system.

Variants gated on multi-node only exist when that feature is enabled. Most user-facing call sites return Result<_, ActorError>; match on the variant when you need to distinguish (e.g. retry on ActorNotReady vs. give up on AddressNotFound).

Variants§

§

OneshotRecv(RecvError)

oneshot::Receiver::await failed (sender dropped before sending). Typically means the actor task died between accepting the message and producing a reply.

§

ChannelSend(String)

Channel send failed — the receiver was dropped. Indicates the target mailbox/loop has shut down. Same variant for both the bounded and unbounded mpsc backends.

§

ChannelRecv

Channel recv returned None — all senders are gone. Same variant for both backends.

§

Timeout(Duration)

A timed send_and_recv (via ActorSystem::send_and_recv_with_timeout or ActorSystem::send_and_recv_without_tx_cache_with_timeout) did not receive its reply within the configured duration. Common cause in multi-node mode: the remote peer died or the broker dropped the in-flight request.

§

AddressRegexError(Error)

address_regex failed to compile (broadcast / restart / unregister).

§

AddressAlreadyExist(String)

Tried to register an actor at an address that’s already taken on this node (and not a restart). Re-registration with the same address fails until the existing entry is unregistered.

§

AddressNotFound(String)

send / send_and_recv / run_job could not find the address in the local actor map. With multi-node this is the local-side failure mode after the routing check decides the call is local.

§

ActorNotReady(String)

The address exists but the actor’s lifecycle is not yet Receiving after the retry budget (10 × 100 ms). Usually means the actor is still in Starting / Restarting.

§

CloneFailed(String)

Reserved for cases where cloning an actor state fails. Currently not produced by the runtime.

§

UnhealthyActorSystem

Actor::register could not reach actor_system_loop after 10 retries — the system is wedged or shutting down.

§

MessageTypeMismatch

Downcast from Arc<dyn Any> / Box<dyn Any> to the expected concrete message or result type failed. Usually means a send::<T> (or send_and_recv::<T>) was routed to an address whose actor type doesn’t match T.

Trait Implementations§

Source§

impl Debug for ActorError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ActorError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ActorError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for ActorError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<RecvError> for ActorError

Source§

fn from(source: RecvError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> MaybeCodec for T
where T: ?Sized,