pub enum Undeliverable<M: Message> {
Returned(M),
Report(DeliveryFailureReport),
}Expand description
An undeliverable M-typed message.
Variants§
Returned(M)
The message was returned intact.
Report(DeliveryFailureReport)
Delivery failed, but the original payload is unavailable.
Implementations§
Source§impl<M: Message> Undeliverable<M>
impl<M: Message> Undeliverable<M>
Sourcepub fn is_returned(&self) -> bool
pub fn is_returned(&self) -> bool
Returns true if this is a Undeliverable::Returned, otherwise false
Sourcepub fn as_returned_mut(&mut self) -> Option<&mut M>
pub fn as_returned_mut(&mut self) -> Option<&mut M>
Optionally returns mutable references to the inner fields if this is a Undeliverable::Returned, otherwise None
Sourcepub fn as_returned(&self) -> Option<&M>
pub fn as_returned(&self) -> Option<&M>
Optionally returns references to the inner fields if this is a Undeliverable::Returned, otherwise None
Sourcepub fn into_returned(self) -> Result<M, Self>
pub fn into_returned(self) -> Result<M, Self>
Returns the inner fields if this is a Undeliverable::Returned, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_report(&self) -> bool
pub fn is_report(&self) -> bool
Returns true if this is a Undeliverable::Report, otherwise false
Sourcepub fn as_report_mut(&mut self) -> Option<&mut DeliveryFailureReport>
pub fn as_report_mut(&mut self) -> Option<&mut DeliveryFailureReport>
Optionally returns mutable references to the inner fields if this is a Undeliverable::Report, otherwise None
Sourcepub fn as_report(&self) -> Option<&DeliveryFailureReport>
pub fn as_report(&self) -> Option<&DeliveryFailureReport>
Optionally returns references to the inner fields if this is a Undeliverable::Report, otherwise None
Sourcepub fn into_report(self) -> Result<DeliveryFailureReport, Self>
pub fn into_report(self) -> Result<DeliveryFailureReport, Self>
Returns the inner fields if this is a Undeliverable::Report, 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 as_message(&self) -> Option<&M>
pub fn as_message(&self) -> Option<&M>
Borrow the returned payload, if the payload was returned.
Sourcepub fn as_message_mut(&mut self) -> Option<&mut M>
pub fn as_message_mut(&mut self) -> Option<&mut M>
Mutably borrow the returned payload, if the payload was returned.
Sourcepub fn into_message(self) -> Result<M, Self>
pub fn into_message(self) -> Result<M, Self>
Consume this undeliverable notification and return its payload, if the payload was returned.
Sourcepub fn report(report: DeliveryFailureReport) -> Self
pub fn report(report: DeliveryFailureReport) -> Self
Construct an undeliverable message that carries only delivery-failure metadata.
Source§impl Undeliverable<MessageEnvelope>
impl Undeliverable<MessageEnvelope>
Sourcepub fn root_delivery_failure(&self) -> Option<&DeliveryFailure>
pub fn root_delivery_failure(&self) -> Option<&DeliveryFailure>
Get the root structured delivery failure for this undeliverable notification.
Sourcepub fn into_error(self) -> UndeliverableMessageError
pub fn into_error(self) -> UndeliverableMessageError
Convert this undeliverable notification into the corresponding error.
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>
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> 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].