Enum ractor::errors::MessagingErr
source · pub enum MessagingErr<T> {
SendErr(T),
ChannelClosed,
InvalidActorType,
}
Expand description
A messaging error has occurred
Variants§
SendErr(T)
The channel you’re trying to send a message too has been dropped/closed. If you’re sending to an crate::ActorCell then that means the actor has died (failure or not).
Includes the message which failed to send so the caller can perform another operation with the message if they want to.
ChannelClosed
The channel you’re trying to receive from has had all the senders dropped and is therefore closed
InvalidActorType
Tried to send a message to an actor with an invalid actor type defined. This happens if you have an crate::ActorCell which has the type id of its handler and you try to use an alternate handler to send a message
Implementations§
source§impl<T> MessagingErr<T>
impl<T> MessagingErr<T>
sourcepub fn map<F, U>(self, mapper: F) -> MessagingErr<U>where
F: FnOnce(T) -> U,
pub fn map<F, U>(self, mapper: F) -> MessagingErr<U>where
F: FnOnce(T) -> U,
Map any message embedded within the error type. This is primarily useful for normalizing an error value if the message is not needed.