Struct async_imap::types::Name
source · pub struct Name { /* private fields */ }
Expand description
A name that matches a LIST
or LSUB
command.
Implementations§
source§impl Name
impl Name
sourcepub fn new(
owner: Box<ResponseData>,
dependent_builder: impl for<'_q> FnOnce(&'_q Box<ResponseData>) -> InnerName<'_q>
) -> Self
pub fn new( owner: Box<ResponseData>, dependent_builder: impl for<'_q> FnOnce(&'_q Box<ResponseData>) -> InnerName<'_q> ) -> Self
Constructs a new self-referential struct.
The provided owner
will be moved into a heap allocated box.
Followed by construction of the dependent value, by calling
dependent_builder
with a shared reference to the owner that
remains valid for the lifetime of the constructed struct.
sourcepub fn try_new<Err>(
owner: Box<ResponseData>,
dependent_builder: impl for<'_q> FnOnce(&'_q Box<ResponseData>) -> Result<InnerName<'_q>, Err>
) -> Result<Self, Err>
pub fn try_new<Err>( owner: Box<ResponseData>, dependent_builder: impl for<'_q> FnOnce(&'_q Box<ResponseData>) -> Result<InnerName<'_q>, Err> ) -> Result<Self, Err>
Tries to create a new structure with a given dependent builder.
Consumes owner on error.
sourcepub fn try_new_or_recover<Err>(
owner: Box<ResponseData>,
dependent_builder: impl for<'_q> FnOnce(&'_q Box<ResponseData>) -> Result<InnerName<'_q>, Err>
) -> Result<Self, (Box<ResponseData>, Err)>
pub fn try_new_or_recover<Err>( owner: Box<ResponseData>, dependent_builder: impl for<'_q> FnOnce(&'_q Box<ResponseData>) -> Result<InnerName<'_q>, Err> ) -> Result<Self, (Box<ResponseData>, Err)>
Tries to create a new structure with a given dependent builder.
Returns owner on error.
sourcepub fn borrow_owner<'_q>(&'_q self) -> &'_q Box<ResponseData>
pub fn borrow_owner<'_q>(&'_q self) -> &'_q Box<ResponseData>
Borrows owner.
sourcepub fn with_dependent<'outer_fn, Ret>(
&'outer_fn self,
func: impl for<'_q> FnOnce(&'_q Box<ResponseData>, &'outer_fn InnerName<'_q>) -> Ret
) -> Ret
pub fn with_dependent<'outer_fn, Ret>( &'outer_fn self, func: impl for<'_q> FnOnce(&'_q Box<ResponseData>, &'outer_fn InnerName<'_q>) -> Ret ) -> Ret
Calls given closure func
with a shared reference to dependent.
sourcepub fn with_dependent_mut<'outer_fn, Ret>(
&'outer_fn mut self,
func: impl for<'_q> FnOnce(&'_q Box<ResponseData>, &'outer_fn mut InnerName<'_q>) -> Ret
) -> Ret
pub fn with_dependent_mut<'outer_fn, Ret>( &'outer_fn mut self, func: impl for<'_q> FnOnce(&'_q Box<ResponseData>, &'outer_fn mut InnerName<'_q>) -> Ret ) -> Ret
Calls given closure func
with an unique reference to dependent.
sourcepub fn borrow_dependent<'_q>(&'_q self) -> &'_q InnerName<'_q>
pub fn borrow_dependent<'_q>(&'_q self) -> &'_q InnerName<'_q>
Borrows dependent.
sourcepub fn into_owner(self) -> Box<ResponseData>
pub fn into_owner(self) -> Box<ResponseData>
Consumes self
and returns the the owner.
source§impl Name
impl Name
sourcepub fn attributes(&self) -> &[NameAttribute<'_>]
pub fn attributes(&self) -> &[NameAttribute<'_>]
Attributes of this name.
sourcepub fn delimiter(&self) -> Option<&str>
pub fn delimiter(&self) -> Option<&str>
The hierarchy delimiter is a character used to delimit levels of hierarchy in a mailbox
name. A client can use it to create child mailboxes, and to search higher or lower levels
of naming hierarchy. All children of a top-level hierarchy node use the same
separator character. None
means that no hierarchy exists; the name is a “flat” name.
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The name represents an unambiguous left-to-right hierarchy, and are valid for use as a
reference in LIST
and LSUB
commands. Unless NameAttribute::NoSelect
is indicated,
the name is also valid as an argument for commands, such as SELECT
, that accept mailbox
names.