Struct async_imap::types::Name

source ·
pub struct Name { /* private fields */ }
Expand description

The self-referencing struct.

Implementations§

source§

impl Name

source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> inner: _
source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> inner: _
source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> inner: _
source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> Result<inner: _, Error_>
source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> Result<inner: _, Error_>
source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> Result<inner: _, Error_>
source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> Result<inner: _, Error_>
source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> Result<inner: _, Error_>
source

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:

ArgumentSuggested Use
responseDirectly pass in the value this field should contain
inner_builderUse a function or closure: (response: &_) -> Result<inner: _, Error_>
source

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.

source

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.

source

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

source

pub fn attributes(&self) -> &[NameAttribute<'_>]

Attributes of this name.

source

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.

source

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.

Trait Implementations§

source§

impl Debug for Name

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Name

§

impl Send for Name

§

impl Sync for Name

§

impl Unpin for Name

§

impl UnwindSafe for Name

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.