Enum imap_types::response::Code
source · pub enum Code<'a> {
Show 16 variants
Alert,
BadCharset {
allowed: Vec<Charset<'a>>,
},
Capability(NonEmptyVec<Capability<'a>>),
Parse,
PermanentFlags(Vec<FlagPerm<'a>>),
ReadOnly,
ReadWrite,
TryCreate,
UidNext(NonZeroU32),
UidValidity(NonZeroU32),
Unseen(NonZeroU32),
Referral(Cow<'a, str>),
CompressionActive,
OverQuota,
TooBig,
Other(CodeOther<'a>),
}
Expand description
A response code consists of data inside square brackets in the form of an atom, possibly followed by a space and arguments. The response code contains additional information or status codes for client software beyond the OK/NO/BAD condition, and are defined when there is a specific action that a client can take based upon the additional information.
The currently defined response codes are:
Variants§
Alert
ALERT
The human-readable text contains a special alert that MUST be presented to the user in a fashion that calls the user’s attention to the message.
BadCharset
BADCHARSET
Optionally followed by a parenthesized list of charsets. A SEARCH failed because the given charset is not supported by this implementation. If the optional list of charsets is given, this lists the charsets that are supported by this implementation.
Capability(NonEmptyVec<Capability<'a>>)
CAPABILITY
Followed by a list of capabilities. This can appear in the initial OK or PREAUTH response to transmit an initial capabilities list. This makes it unnecessary for a client to send a separate CAPABILITY command if it recognizes this response.
Parse
PARSE
The human-readable text represents an error in parsing the [RFC-2822] header or [MIME-IMB] headers of a message in the mailbox.
PermanentFlags(Vec<FlagPerm<'a>>)
PERMANENTFLAGS
Followed by a parenthesized list of flags, indicates which of the known flags the client can change permanently. Any flags that are in the FLAGS untagged response, but not the PERMANENTFLAGS list, can not be set permanently. If the client attempts to STORE a flag that is not in the PERMANENTFLAGS list, the server will either ignore the change or store the state change for the remainder of the current session only. The PERMANENTFLAGS list can also include the special flag *, which indicates that it is possible to create new keywords by attempting to store those flags in the mailbox.
ReadOnly
READ-ONLY
The mailbox is selected read-only, or its access while selected has changed from read-write to read-only.
ReadWrite
READ-WRITE
The mailbox is selected read-write, or its access while selected has changed from read-only to read-write.
TryCreate
TRYCREATE
An APPEND or COPY attempt is failing because the target mailbox does not exist (as opposed to some other reason). This is a hint to the client that the operation can succeed if the mailbox is first created by the CREATE command.
UidNext(NonZeroU32)
UIDNEXT
Followed by a decimal number, indicates the next unique identifier value. Refer to section 2.3.1.1 for more information.
UidValidity(NonZeroU32)
UIDVALIDITY
Followed by a decimal number, indicates the unique identifier validity value. Refer to section 2.3.1.1 for more information.
Unseen(NonZeroU32)
UNSEEN
Followed by a decimal number, indicates the number of the first message without the \Seen flag set.
Referral(Cow<'a, str>)
ext_mailbox_referrals
or ext_login_referrals
only.IMAP4 Login Referrals (RFC 2221)
CompressionActive
ext_compress
only.OverQuota
ext_quota
only.SHOULD be returned in the tagged NO response to an APPEND/COPY/MOVE when the addition of the message(s) puts the target mailbox over any one of its quota limits.
TooBig
ext_literal
only.Server got a non-synchronizing literal larger than 4096 bytes.
Other(CodeOther<'a>)
Additional response codes defined by particular client or server implementations SHOULD be prefixed with an “X” until they are added to a revision of this protocol. Client implementations SHOULD ignore response codes that they do not recognize.
atom [SP 1*<any TEXT-CHAR except "]">]`
Note: We use this as a fallback for everything that was not recognized as
Code
. This includes, e.g., variants with missing parameters, etc.
Implementations§
source§impl<'a> Code<'a>
impl<'a> Code<'a>
pub fn badcharset(allowed: Vec<Charset<'a>>) -> Self
pub fn capability<C>(caps: C) -> Result<Self, C::Error>where C: TryInto<NonEmptyVec<Capability<'a>>>,
pub fn permanentflags(flags: Vec<FlagPerm<'a>>) -> Self
pub fn uidnext(uidnext: u32) -> Result<Self, TryFromIntError>
pub fn uidvalidity(uidnext: u32) -> Result<Self, TryFromIntError>
pub fn unseen(uidnext: u32) -> Result<Self, TryFromIntError>
Trait Implementations§
source§impl<'a, 'arbitrary: 'a> Arbitrary<'arbitrary> for Code<'a>
impl<'a, 'arbitrary: 'a> Arbitrary<'arbitrary> for Code<'a>
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read more