#[non_exhaustive]pub struct OutboundMessage { /* private fields */ }Expand description
A Message that has passed outbound delivery validation.
A Message that has passed outbound delivery validation.
The serde representation matches Message verbatim; deserializing
runs OutboundMessage::new so an invalid payload is rejected
instead of silently bypassing the typestate invariant.
Implementations§
Source§impl OutboundMessage
impl OutboundMessage
Sourcepub fn new(message: Message) -> Result<Self, MessageValidationError>
pub fn new(message: Message) -> Result<Self, MessageValidationError>
Validate and wrap a message for outbound delivery.
§Errors
Returns MessageValidationError when required outbound fields are
missing or inconsistent.
pub const fn as_message(&self) -> &Message
pub fn into_message(self) -> Message
Sourcepub const fn from_mailbox(&self) -> &Mailbox
pub const fn from_mailbox(&self) -> &Mailbox
Returns the validated From mailbox.
Outbound validation guarantees the From field is set, so this
accessor is infallible (unlike Message::from_mailbox, which
returns Option<&Mailbox>).
Trait Implementations§
Source§impl Clone for OutboundMessage
impl Clone for OutboundMessage
Source§fn clone(&self) -> OutboundMessage
fn clone(&self) -> OutboundMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OutboundMessage
impl Debug for OutboundMessage
Source§impl<'de> Deserialize<'de> for OutboundMessage
Available on crate feature serde only.
impl<'de> Deserialize<'de> for OutboundMessage
Available on crate feature
serde only.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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<OutboundMessage> for Message
impl From<OutboundMessage> for Message
Source§fn from(value: OutboundMessage) -> Self
fn from(value: OutboundMessage) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for OutboundMessage
Available on crate feature schemars only.
impl JsonSchema for OutboundMessage
Available on crate feature
schemars only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for OutboundMessage
impl PartialEq for OutboundMessage
Source§impl Serialize for OutboundMessage
Available on crate feature serde only.
impl Serialize for OutboundMessage
Available on crate feature
serde only.Source§impl TryFrom<Message> for OutboundMessage
impl TryFrom<Message> for OutboundMessage
impl Eq for OutboundMessage
impl StructuralPartialEq for OutboundMessage
Auto Trait Implementations§
impl Freeze for OutboundMessage
impl RefUnwindSafe for OutboundMessage
impl Send for OutboundMessage
impl Sync for OutboundMessage
impl Unpin for OutboundMessage
impl UnsafeUnpin for OutboundMessage
impl UnwindSafe for OutboundMessage
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