#[non_exhaustive]pub struct MessageId(/* private fields */);Expand description
A validated RFC 5322 message-ID (bare, without angle brackets).
RFC 5322 Section 3.6.4 defines msg-id = "<" id-left "@" id-right ">".
This type stores only the bare id-left "@" id-right content. Angle
brackets are added by the builder when emitting wire format.
§Validation rules
- Non-empty
- Exactly one
@separator id-leftandid-rightmust each be non-empty- No whitespace, angle brackets, or control characters
§References
- RFC 5322 Section 3.6.4 (message identification)
Implementations§
Source§impl MessageId
impl MessageId
Sourcepub fn new(s: impl Into<String>) -> Result<Self>
pub fn new(s: impl Into<String>) -> Result<Self>
Creates a new MessageId after validation (RFC 5322 Section 3.6.4).
The value must be a bare message-ID (no angle brackets) containing
exactly one @ with non-empty parts on each side, and no
whitespace, angle brackets, or control characters.
§Errors
Returns crate::error::Error::InvalidMessageId if validation fails.
§References
- RFC 5322 Section 3.6.4
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes self and returns the inner String.
Trait Implementations§
impl Eq for MessageId
impl StructuralPartialEq for MessageId
Auto Trait Implementations§
impl Freeze for MessageId
impl RefUnwindSafe for MessageId
impl Send for MessageId
impl Sync for MessageId
impl Unpin for MessageId
impl UnsafeUnpin for MessageId
impl UnwindSafe for MessageId
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