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

source

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.

source

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.

source

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.

source

pub fn borrow_owner<'_q>(&'_q self) -> &'_q Box<ResponseData>

Borrows owner.

source

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.

source

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.

source

pub fn borrow_dependent<'_q>(&'_q self) -> &'_q InnerName<'_q>

Borrows dependent.

source

pub fn into_owner(self) -> Box<ResponseData>

Consumes self and returns the the owner.

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, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Drop for Name

source§

fn drop(&mut self)

Executes the destructor for this type. 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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

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 T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more