Struct async_imap::types::Name
source · pub struct Name { /* private fields */ }
Expand description
The self-referencing struct.
Implementations§
source§impl Name
impl Name
sourcepub fn new(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> InnerName<'this>
) -> Name
pub fn new( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> InnerName<'this> ) -> Name
Constructs a new instance of this self-referential struct. (See also NameBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> inner: _ |
sourcepub async fn new_async(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = InnerName<'this>> + 'this>>
) -> Name
pub async fn new_async( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = InnerName<'this>> + 'this>> ) -> Name
Constructs a new instance of this self-referential struct. (See also NameAsyncBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> inner: _ |
sourcepub async fn new_async_send(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = InnerName<'this>> + Send + 'this>>
) -> Name
pub async fn new_async_send( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = InnerName<'this>> + Send + 'this>> ) -> Name
Constructs a new instance of this self-referential struct. (See also NameAsyncSendBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> inner: _ |
sourcepub fn try_new<Error_>(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Result<InnerName<'this>, Error_>
) -> Result<Name, Error_>
pub fn try_new<Error_>( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Result<InnerName<'this>, Error_> ) -> Result<Name, Error_>
(See also NameTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> Result<inner: _, Error_> |
sourcepub fn try_new_or_recover<Error_>(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Result<InnerName<'this>, Error_>
) -> Result<Name, (Error_, Heads)>
pub fn try_new_or_recover<Error_>( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Result<InnerName<'this>, Error_> ) -> Result<Name, (Error_, Heads)>
(See also NameTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> Result<inner: _, Error_> |
sourcepub async fn try_new_async<Error_>(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = Result<InnerName<'this>, Error_>> + 'this>>
) -> Result<Name, Error_>
pub async fn try_new_async<Error_>( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = Result<InnerName<'this>, Error_>> + 'this>> ) -> Result<Name, Error_>
(See also NameAsyncTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> Result<inner: _, Error_> |
sourcepub async fn try_new_or_recover_async<Error_>(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = Result<InnerName<'this>, Error_>> + 'this>>
) -> Result<Name, (Error_, Heads)>
pub async fn try_new_or_recover_async<Error_>( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = Result<InnerName<'this>, Error_>> + 'this>> ) -> Result<Name, (Error_, Heads)>
(See also NameAsyncTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> Result<inner: _, Error_> |
sourcepub async fn try_new_async_send<Error_>(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = Result<InnerName<'this>, Error_>> + Send + 'this>>
) -> Result<Name, Error_>
pub async fn try_new_async_send<Error_>( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = Result<InnerName<'this>, Error_>> + Send + 'this>> ) -> Result<Name, Error_>
(See also NameAsyncSendTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> Result<inner: _, Error_> |
sourcepub async fn try_new_or_recover_async_send<Error_>(
response: Box<ResponseData>,
inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = Result<InnerName<'this>, Error_>> + Send + 'this>>
) -> Result<Name, (Error_, Heads)>
pub async fn try_new_or_recover_async_send<Error_>( response: Box<ResponseData>, inner_builder: impl for<'this> FnOnce(&'this Box<ResponseData>) -> Pin<Box<dyn Future<Output = Result<InnerName<'this>, Error_>> + Send + 'this>> ) -> Result<Name, (Error_, Heads)>
(See also NameAsyncSendTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | Suggested Use |
---|---|
response | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (response: &_) -> Result<inner: _, Error_> |
sourcepub fn with<'outer_borrow, ReturnType>(
&'outer_borrow self,
user: impl for<'this> FnOnce(BorrowedFields<'outer_borrow, 'this>) -> ReturnType
) -> ReturnType
pub fn with<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(BorrowedFields<'outer_borrow, 'this>) -> ReturnType ) -> ReturnType
This method provides immutable references to all tail and immutably borrowed fields.
sourcepub fn with_mut<'outer_borrow, ReturnType>(
&'outer_borrow mut self,
user: impl for<'this> FnOnce(BorrowedMutFields<'outer_borrow, 'this>) -> ReturnType
) -> ReturnType
pub fn with_mut<'outer_borrow, ReturnType>( &'outer_borrow mut self, user: impl for<'this> FnOnce(BorrowedMutFields<'outer_borrow, 'this>) -> ReturnType ) -> ReturnType
This method provides mutable references to all tail fields.
sourcepub fn into_heads(self) -> Heads
pub fn into_heads(self) -> Heads
This function drops all internally referencing fields and returns only the head fields of this struct.
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.