pub enum RactorErr<T> {
Spawn(SpawnErr),
Messaging(MessagingErr<T>),
Actor(ActorErr),
Timeout,
}
Expand description
Error types which can result from Ractor processes
Variants§
Spawn(SpawnErr)
An error occurred spawning
Messaging(MessagingErr<T>)
An error occurred in messaging (sending/receiving)
Actor(ActorErr)
An actor encountered an error while processing (canceled or panicked)
Timeout
A timeout occurred
Implementations§
source§impl<T> RactorErr<T>
impl<T> RactorErr<T>
sourcepub fn has_message(&self) -> bool
pub fn has_message(&self) -> bool
sourcepub fn try_get_message(self) -> Option<T>
pub fn try_get_message(self) -> Option<T>
Try and extract the message payload from the contained error. This consumes the
RactorErr instance in order to not have require cloning the message payload.
Should be used in conjunction with has_message
to not consume the error if not wanted
Returns [Some(T
)] if there is a message payload, None otherwise.
Trait Implementations§
source§impl<T> Error for RactorErr<T>
impl<T> Error for RactorErr<T>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<T, TResult> From<CallResult<TResult>> for RactorErr<T>
impl<T, TResult> From<CallResult<TResult>> for RactorErr<T>
source§fn from(value: CallResult<TResult>) -> Self
fn from(value: CallResult<TResult>) -> Self
Converts to this type from the input type.
source§impl<T> From<MessagingErr<T>> for RactorErr<T>
impl<T> From<MessagingErr<T>> for RactorErr<T>
source§fn from(value: MessagingErr<T>) -> Self
fn from(value: MessagingErr<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for RactorErr<T>where
T: Freeze,
impl<T> !RefUnwindSafe for RactorErr<T>
impl<T> Send for RactorErr<T>where
T: Send,
impl<T> Sync for RactorErr<T>
impl<T> Unpin for RactorErr<T>where
T: Unpin,
impl<T> !UnwindSafe for RactorErr<T>
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> 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