Enum imap_types::state::State

source ·
pub enum State<'a> {
    Greeting,
    NotAuthenticated,
    Authenticated,
    Selected(Mailbox<'a>),
    Logout,
    IdleAuthenticated(Tag<'a>),
    IdleSelected(Tag<'a>, Mailbox<'a>),
}
Expand description

State of the IMAP4rev1 connection.

Variants§

§

Greeting

§

NotAuthenticated

The client MUST supply authentication credentials before most commands will be permitted. This state is entered when a connection starts unless the connection has been pre-authenticated.

§

Authenticated

The client is authenticated and MUST select a mailbox to access before commands that affect messages will be permitted. This state is entered when a pre-authenticated connection starts, when acceptable authentication credentials have been provided, after an error in selecting a mailbox, or after a successful CLOSE command.

§

Selected(Mailbox<'a>)

A mailbox has been selected to access. This state is entered when a mailbox has been successfully selected.

§

Logout

The connection is being terminated. This state can be entered as a result of a client request (via the LOGOUT command) or by unilateral action on the part of either the client or server.

If the client requests the logout state, the server MUST send an untagged BYE response and a tagged OK response to the LOGOUT command before the server closes the connection; and the client MUST read the tagged OK response to the LOGOUT command before the client closes the connection.

A server MUST NOT unilaterally close the connection without sending an untagged BYE response that contains the reason for having done so. A client SHOULD NOT unilaterally close the connection, and instead SHOULD issue a LOGOUT command. If the server detects that the client has unilaterally closed the connection, the server MAY omit the untagged BYE response and simply close its connection.

§

IdleAuthenticated(Tag<'a>)

§

IdleSelected(Tag<'a>, Mailbox<'a>)

Trait Implementations§

source§

impl<'a> Clone for State<'a>

source§

fn clone(&self) -> State<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for State<'a>

source§

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

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

impl<'de, 'a> Deserialize<'de> for State<'a>

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a> IntoBoundedStatic for State<'a>

§

type Static = State<'static>

The target type is bounded by the 'static lifetime.
source§

fn into_static(self) -> Self::Static

Convert an owned T into an owned T such that T: 'static.
source§

impl<'a> PartialEq<State<'a>> for State<'a>

source§

fn eq(&self, other: &State<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Serialize for State<'a>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> ToBoundedStatic for State<'a>

§

type Static = State<'static>

The target type is bounded by the 'static lifetime.
source§

fn to_static(&self) -> Self::Static

Convert an &T to an owned T such that T: 'static.
source§

impl<'a> Eq for State<'a>

source§

impl<'a> StructuralEq for State<'a>

source§

impl<'a> StructuralPartialEq for State<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for State<'a>

§

impl<'a> Send for State<'a>

§

impl<'a> Sync for State<'a>

§

impl<'a> Unpin for State<'a>

§

impl<'a> UnwindSafe for State<'a>

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,