pub enum EnvelopeAddress {
Null,
Postmaster,
Path(MailPath),
}Expand description
An envelope address: either a path, null sender, or postmaster.
Variants§
Null
Null sender: <>
Postmaster
Postmaster: <Postmaster> or Postmaster
Path(MailPath)
A path: <path> or bare path
Implementations§
Source§impl EnvelopeAddress
impl EnvelopeAddress
Sourcepub fn parse(input: &str) -> Result<Self>
pub fn parse(input: &str) -> Result<Self>
Parse an envelope address from a string.
Accepts either forward or reverse path syntax, with or without angle brackets. Returns anyhow::Result for easier error handling with anyhow-based code.
Sourcepub fn user(&self) -> String
pub fn user(&self) -> String
Returns the local-part (user) portion of the address. Returns “postmaster” for Postmaster, empty string for Null.
Sourcepub fn domain(&self) -> String
pub fn domain(&self) -> String
Returns the domain portion of the address. Returns empty string for Postmaster and Null.
Sourcepub fn null_sender() -> Self
pub fn null_sender() -> Self
Returns the null sender address: EnvelopeAddress::Null
Trait Implementations§
Source§impl Clone for EnvelopeAddress
impl Clone for EnvelopeAddress
Source§fn clone(&self) -> EnvelopeAddress
fn clone(&self) -> EnvelopeAddress
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 EnvelopeAddress
impl Debug for EnvelopeAddress
Source§impl<'de> Deserialize<'de> for EnvelopeAddress
impl<'de> Deserialize<'de> for EnvelopeAddress
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 Display for EnvelopeAddress
impl Display for EnvelopeAddress
Source§impl From<EnvelopeAddress> for String
impl From<EnvelopeAddress> for String
Source§fn from(addr: EnvelopeAddress) -> Self
fn from(addr: EnvelopeAddress) -> Self
Converts to this type from the input type.
Source§impl From<ForwardPath> for EnvelopeAddress
impl From<ForwardPath> for EnvelopeAddress
Source§fn from(fp: ForwardPath) -> Self
fn from(fp: ForwardPath) -> Self
Converts to this type from the input type.
Source§impl From<MailPath> for EnvelopeAddress
impl From<MailPath> for EnvelopeAddress
Source§impl From<Mailbox> for EnvelopeAddress
Infallible conversion: wraps a Mailbox in an EnvelopeAddress::Path.
impl From<Mailbox> for EnvelopeAddress
Infallible conversion: wraps a Mailbox in an EnvelopeAddress::Path.
Source§impl FromLua for EnvelopeAddress
Available on crate feature lua only.
impl FromLua for EnvelopeAddress
Available on crate feature
lua only.Source§impl FromStr for EnvelopeAddress
impl FromStr for EnvelopeAddress
Source§impl Hash for EnvelopeAddress
impl Hash for EnvelopeAddress
Source§impl PartialEq for EnvelopeAddress
impl PartialEq for EnvelopeAddress
Source§impl Serialize for EnvelopeAddress
impl Serialize for EnvelopeAddress
Source§impl TryFrom<EnvelopeAddress> for ForwardPath
impl TryFrom<EnvelopeAddress> for ForwardPath
Source§impl TryFrom<EnvelopeAddress> for MailPath
impl TryFrom<EnvelopeAddress> for MailPath
Source§impl TryFrom<EnvelopeAddress> for Mailbox
impl TryFrom<EnvelopeAddress> for Mailbox
Source§impl TryFrom<EnvelopeAddress> for ReversePath
impl TryFrom<EnvelopeAddress> for ReversePath
Source§impl TryFrom<ReversePath> for EnvelopeAddress
impl TryFrom<ReversePath> for EnvelopeAddress
Source§impl TryFrom<String> for EnvelopeAddress
impl TryFrom<String> for EnvelopeAddress
Source§impl UserData for EnvelopeAddress
Available on crate feature lua only.
impl UserData for EnvelopeAddress
Available on crate feature
lua only.Source§fn add_fields<F: UserDataFields<Self>>(fields: &mut F)
fn add_fields<F: UserDataFields<Self>>(fields: &mut F)
Adds custom fields specific to this userdata.
Source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
Adds custom methods and operators specific to this userdata.
impl Eq for EnvelopeAddress
impl StructuralPartialEq for EnvelopeAddress
Auto Trait Implementations§
impl Freeze for EnvelopeAddress
impl RefUnwindSafe for EnvelopeAddress
impl Send for EnvelopeAddress
impl Sync for EnvelopeAddress
impl Unpin for EnvelopeAddress
impl UnwindSafe for EnvelopeAddress
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> FromLuaMulti for Twhere
T: FromLua,
impl<T> FromLuaMulti for Twhere
T: FromLua,
§fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
Performs the conversion. Read more
fn from_lua_args( args: MultiValue, i: usize, to: Option<&str>, lua: &Lua, ) -> Result<T, Error>
unsafe fn from_stack_multi(nvals: i32, lua: &RawLua) -> Result<T, Error>
unsafe fn from_stack_args( nargs: i32, i: usize, to: Option<&str>, lua: &RawLua, ) -> Result<T, Error>
§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>
Converts
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>
Converts
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> IntoLua for Twhere
T: UserData + MaybeSend + 'static,
impl<T> IntoLua for Twhere
T: UserData + MaybeSend + 'static,
§impl<T> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
Performs the conversion.