[][src]Struct async_imap::types::Name

pub struct Name { /* fields omitted */ }

A name that matches a LIST or LSUB command.

Implementations

impl Name[src]

pub fn new<__Finner>(response: Box<ResponseData>, inner: __Finner) -> Self where
    __Finner: for<'response> FnOnce(&'response ResponseData) -> InnerName<'response>, 
[src]

Create a new instance of the rental struct.

The first argument provided is the head, followed by a series of closures, one for each tail field. Each of these closures will receive, as its arguments, a borrow of the previous field, followed by borrows of the remaining prefix fields if the struct is a shared rental. If the struct is a mutable rental, only the immediately preceding field is passed.

pub fn try_new<__Finner, __E>(
    response: Box<ResponseData>,
    inner: __Finner
) -> RentalResult<Self, __E, Box<ResponseData>> where
    __Finner: for<'response> FnOnce(&'response ResponseData) -> Result<InnerName<'response>, __E>, 
[src]

Attempt to create a new instance of the rental struct.

As new, but each closure returns a Result. If one of them fails, execution is short-circuited and a tuple of the error and the original head value is returned to you.

pub fn try_new_or_drop<__Finner, __E>(
    response: Box<ResponseData>,
    inner: __Finner
) -> Result<Self, __E> where
    __Finner: for<'response> FnOnce(&'response ResponseData) -> Result<InnerName<'response>, __E>, 
[src]

Attempt to create a new instance of the rental struct.

As try_new, but only the error value is returned upon failure; the head value is dropped. This method interacts more smoothly with existing error conversions.

pub unsafe fn all_erased(&self) -> Self::Borrow[src]

Return lifetime-erased shared borrows of the fields of the struct.

This is unsafe because the erased lifetimes are fake. Use this only if absolutely necessary and be very mindful of what the true lifetimes are.

pub unsafe fn all_mut_erased(&mut self) -> Self::BorrowMut[src]

Return a lifetime-erased mutable borrow of the suffix of the struct.

This is unsafe because the erased lifetimes are fake. Use this only if absolutely necessary and be very mindful of what the true lifetimes are.

pub fn rent<__F, __R>(&self, f: __F) -> __R where
    __F: for<'inner, 'response> FnOnce(&'inner InnerName<'response>) -> __R,
    __R: , 
[src]

Execute a closure on the shared suffix of the struct.

The closure may return any value not bounded by one of the special rental lifetimes of the struct.

pub fn rent_mut<__F, __R>(&mut self, f: __F) -> __R where
    __F: for<'inner, 'response> FnOnce(&'inner mut InnerName<'response>) -> __R,
    __R: , 
[src]

Execute a closure on the mutable suffix of the struct.

The closure may return any value not bounded by one of the special rental lifetimes of the struct.

pub fn ref_rent<__F, __R>(&self, f: __F) -> &__R where
    __F: for<'inner, 'response> FnOnce(&'inner InnerName<'response>) -> &'inner __R,
    __R: ?Sized
[src]

Return a shared reference from the shared suffix of the struct.

This is a subtle variation of rent where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn maybe_ref_rent<__F, __R>(&self, f: __F) -> Option<&__R> where
    __F: for<'inner, 'response> FnOnce(&'inner InnerName<'response>) -> Option<&'inner __R>,
    __R: ?Sized
[src]

Optionally return a shared reference from the shared suffix of the struct.

This is a subtle variation of rent where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn try_ref_rent<__F, __R, __E>(&self, f: __F) -> Result<&__R, __E> where
    __F: for<'inner, 'response> FnOnce(&'inner InnerName<'response>) -> Result<&'inner __R, __E>,
    __R: ?Sized
[src]

Try to return a shared reference from the shared suffix of the struct, or an error on failure.

This is a subtle variation of rent where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn ref_rent_mut<__F, __R>(&mut self, f: __F) -> &mut __R where
    __F: for<'inner, 'response> FnOnce(&'inner mut InnerName<'response>) -> &'inner mut __R,
    __R: ?Sized
[src]

Return a mutable reference from the mutable suffix of the struct.

This is a subtle variation of rent_mut where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn maybe_ref_rent_mut<__F, __R>(&mut self, f: __F) -> Option<&mut __R> where
    __F: for<'inner, 'response> FnOnce(&'inner mut InnerName<'response>) -> Option<&'inner mut __R>,
    __R: ?Sized
[src]

Optionally return a mutable reference from the mutable suffix of the struct.

This is a subtle variation of rent_mut where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn try_ref_rent_mut<__F, __R, __E>(
    &mut self,
    f: __F
) -> Result<&mut __R, __E> where
    __F: for<'inner, 'response> FnOnce(&'inner mut InnerName<'response>) -> Result<&'inner mut __R, __E>,
    __R: ?Sized
[src]

Try to return a mutable reference from the mutable suffix of the struct, or an error on failure.

This is a subtle variation of rent_mut where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn into_head(self) -> Box<ResponseData>[src]

Drop the rental struct and return the original head value to you.

impl Name[src]

pub fn head(&self) -> &<Box<ResponseData> as Deref>::Target[src]

Return a shared reference to the head field of the struct.

pub fn rent_all<__F, __R>(&self, f: __F) -> __R where
    __F: for<'response, 'inner> FnOnce(Name_Borrow<'response, 'inner>) -> __R,
    __R: , 
[src]

Execute a closure on shared borrows of the fields of the struct.

The closure may return any value not bounded by one of the special rental lifetimes of the struct.

pub fn ref_rent_all<__F, __R>(&self, f: __F) -> &__R where
    __F: for<'response, 'inner> FnOnce(Name_Borrow<'response, 'inner>) -> &'inner __R,
    __R: ?Sized
[src]

Return a shared reference from shared borrows of the fields of the struct.

This is a subtle variation of rent_all where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn maybe_ref_rent_all<__F, __R>(&self, f: __F) -> Option<&__R> where
    __F: for<'response, 'inner> FnOnce(Name_Borrow<'response, 'inner>) -> Option<&'inner __R>,
    __R: ?Sized
[src]

Optionally return a shared reference from shared borrows of the fields of the struct.

This is a subtle variation of rent_all where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn try_ref_rent_all<__F, __R, __E>(&self, f: __F) -> Result<&__R, __E> where
    __F: for<'response, 'inner> FnOnce(Name_Borrow<'response, 'inner>) -> Result<&'inner __R, __E>,
    __R: ?Sized
[src]

Try to return a shared reference from shared borrows of the fields of the struct, or an error on failure.

This is a subtle variation of rent_all where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn rent_all_mut<__F, __R>(&mut self, f: __F) -> __R where
    __F: for<'response, 'inner> FnOnce(Name_BorrowMut<'response, 'inner>) -> __R,
    __R: , 
[src]

Execute a closure on shared borrows of the prefix fields and a mutable borrow of the suffix field of the struct.

The closure may return any value not bounded by one of the special rental lifetimes of the struct.

pub fn ref_rent_all_mut<__F, __R>(&mut self, f: __F) -> &mut __R where
    __F: for<'response, 'inner> FnOnce(Name_BorrowMut<'response, 'inner>) -> &'inner mut __R,
    __R: ?Sized
[src]

Return a mutable reference from shared borrows of the prefix fields and a mutable borrow of the suffix field of the struct.

This is a subtle variation of rent_all_mut where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn maybe_ref_rent_all_mut<__F, __R>(&mut self, f: __F) -> Option<&mut __R> where
    __F: for<'response, 'inner> FnOnce(Name_BorrowMut<'response, 'inner>) -> Option<&'inner mut __R>,
    __R: ?Sized
[src]

Optionally return a mutable reference from shared borrows of the prefix fields and a mutable borrow of the suffix field of the struct.

This is a subtle variation of rent_all_mut where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

pub fn try_ref_rent_all_mut<__F, __R, __E>(
    &mut self,
    f: __F
) -> Result<&mut __R, __E> where
    __F: for<'response, 'inner> FnOnce(Name_BorrowMut<'response, 'inner>) -> Result<&'inner mut __R, __E>,
    __R: ?Sized
[src]

Try to return a mutable reference from shared borrows of the prefix fields and a mutable borrow of the suffix field of the struct, or an error on failure.

This is a subtle variation of rent_all_mut where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.

impl Name[src]

pub fn all<'__s>(&'__s self) -> Self::Borrow[src]

Borrow all fields of the struct by reborrowing away the rental lifetimes.

This is safe because the lifetimes are verified to be covariant first.

pub fn suffix(&self) -> <Self::Borrow as IntoSuffix>::Suffix[src]

Borrow the suffix field of the struct by reborrowing away the rental lifetimes.

This is safe because the lifetimes are verified to be covariant first.

impl Name[src]

pub fn attributes(&self) -> &[NameAttribute][src]

Attributes of this name.

pub fn delimiter(&self) -> Option<&str>[src]

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.

pub fn name(&self) -> &str[src]

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

impl Debug for Name where
    Box<ResponseData>: Debug,
    InnerName<'static>: Debug
[src]

impl<'response: 'inner, 'inner> Rental2<'response, 'inner> for Name[src]

type Borrow = Name_Borrow<'response, 'inner>

type BorrowMut = Name_BorrowMut<'response, 'inner>

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.