Enum mail_parser::Address
source · pub enum Address<'x> {
List(Vec<Addr<'x>>),
Group(Vec<Group<'x>>),
}
Variants§
Implementations§
source§impl<'x> Address<'x>
impl<'x> Address<'x>
sourcepub fn first(&self) -> Option<&Addr<'x>>
pub fn first(&self) -> Option<&Addr<'x>>
Returns the first address in the list, or the first address in the first group.
sourcepub fn last(&self) -> Option<&Addr<'x>>
pub fn last(&self) -> Option<&Addr<'x>>
Returns the last address in the list, or the last address in the last group.
sourcepub fn into_group(self) -> Vec<Group<'x>>
pub fn into_group(self) -> Vec<Group<'x>>
Converts the address into a group of Addr
.
sourcepub fn as_list(&self) -> Option<&[Addr<'x>]>
pub fn as_list(&self) -> Option<&[Addr<'x>]>
Returns the list of addresses, or None
if the address is a group.
sourcepub fn as_group(&self) -> Option<&[Group<'x>]>
pub fn as_group(&self) -> Option<&[Group<'x>]>
Returns the group of addresses, or None
if the address is a list.
sourcepub fn iter<'y: 'x>(
&'y self
) -> Box<dyn DoubleEndedIterator<Item = &Addr<'x>> + 'x>
pub fn iter<'y: 'x>( &'y self ) -> Box<dyn DoubleEndedIterator<Item = &Addr<'x>> + 'x>
Returns an iterator over the addresses in the list, or the addresses in the groups.
sourcepub fn contains(&self, addr: &str) -> bool
pub fn contains(&self, addr: &str) -> bool
Returns whether the list contains the given address.
pub fn into_owned(self) -> Address<'static>
Trait Implementations§
source§impl<'x> PartialEq for Address<'x>
impl<'x> PartialEq for Address<'x>
impl<'x> Eq for Address<'x>
impl<'x> StructuralPartialEq for Address<'x>
Auto Trait Implementations§
impl<'x> Freeze for Address<'x>
impl<'x> RefUnwindSafe for Address<'x>
impl<'x> Send for Address<'x>
impl<'x> Sync for Address<'x>
impl<'x> Unpin for Address<'x>
impl<'x> UnwindSafe for Address<'x>
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