pub enum Undeliverable<M: Message> {
Message(M),
Lost(LostMessage),
}Expand description
An undeliverable M-typed message.
Variants§
Message(M)
The message was returned intact.
Lost(LostMessage)
The message was lost before it could be returned.
Implementations§
Source§impl<M: Message> Undeliverable<M>
impl<M: Message> Undeliverable<M>
Sourcepub fn is_message(&self) -> bool
pub fn is_message(&self) -> bool
Returns true if this is a Undeliverable::Message, otherwise false
Sourcepub fn as_message_mut(&mut self) -> Option<&mut M>
pub fn as_message_mut(&mut self) -> Option<&mut M>
Optionally returns mutable references to the inner fields if this is a Undeliverable::Message, otherwise None
Sourcepub fn as_message(&self) -> Option<&M>
pub fn as_message(&self) -> Option<&M>
Optionally returns references to the inner fields if this is a Undeliverable::Message, otherwise None
Sourcepub fn into_message(self) -> Result<M, Self>
pub fn into_message(self) -> Result<M, Self>
Returns the inner fields if this is a Undeliverable::Message, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_lost_mut(&mut self) -> Option<&mut LostMessage>
pub fn as_lost_mut(&mut self) -> Option<&mut LostMessage>
Optionally returns mutable references to the inner fields if this is a Undeliverable::Lost, otherwise None
Sourcepub fn as_lost(&self) -> Option<&LostMessage>
pub fn as_lost(&self) -> Option<&LostMessage>
Optionally returns references to the inner fields if this is a Undeliverable::Lost, otherwise None
Sourcepub fn into_lost(self) -> Result<LostMessage, Self>
pub fn into_lost(self) -> Result<LostMessage, Self>
Returns the inner fields if this is a Undeliverable::Lost, otherwise returns back the enum in the Err case of the result
Source§impl<M: Message> Undeliverable<M>
impl<M: Message> Undeliverable<M>
Sourcepub fn message(message: M) -> Self
pub fn message(message: M) -> Self
Construct an undeliverable message that preserves the original payload.
Sourcepub fn lost(message: LostMessage) -> Self
pub fn lost(message: LostMessage) -> Self
Construct an undeliverable message that carries only lost-message metadata.
Trait Implementations§
Source§impl<M: Clone + Message> Clone for Undeliverable<M>
impl<M: Clone + Message> Clone for Undeliverable<M>
Source§fn clone(&self) -> Undeliverable<M>
fn clone(&self) -> Undeliverable<M>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, M> Deserialize<'de> for Undeliverable<M>where
M: Deserialize<'de> + Message,
impl<'de, M> Deserialize<'de> for Undeliverable<M>where
M: Deserialize<'de> + Message,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<M: Message + Named> Named for Undeliverable<M>
impl<M: Message + Named> Named for Undeliverable<M>
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn arm(&self) -> Option<&'static str>
fn arm(&self) -> Option<&'static str>
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§impl<M> Serialize for Undeliverable<M>
impl<M> Serialize for Undeliverable<M>
impl<M: Message> StructuralPartialEq for Undeliverable<M>
Auto Trait Implementations§
impl<M> Freeze for Undeliverable<M>where
M: Freeze,
impl<M> RefUnwindSafe for Undeliverable<M>where
M: RefUnwindSafe,
impl<M> Send for Undeliverable<M>
impl<M> Sync for Undeliverable<M>
impl<M> Unpin for Undeliverable<M>where
M: Unpin,
impl<M> UnsafeUnpin for Undeliverable<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for Undeliverable<M>where
M: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
Source§impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, A>,
message: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, A>,
message: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].