Enum Command

Source
pub enum Command {
Show 14 variants Ehlo { domain_or_address: DomainOrAddress, }, Helo { domain_or_address: DomainOrAddress, }, Mail { reverse_path: String, parameters: Vec<Parameter>, }, Rcpt { forward_path: String, parameters: Vec<Parameter>, }, Data, Rset, Vrfy { user_or_mailbox: AtomOrQuoted, }, Expn { mailing_list: AtomOrQuoted, }, Help { argument: Option<AtomOrQuoted>, }, Noop { argument: Option<AtomOrQuoted>, }, Quit, StartTLS, AuthLogin(Option<String>), AuthPlain(Option<String>),
}

Variants§

§

Ehlo

Fields

§domain_or_address: DomainOrAddress
§

Helo

Fields

§domain_or_address: DomainOrAddress
§

Mail

Fields

§reverse_path: String
§parameters: Vec<Parameter>
§

Rcpt

Fields

§forward_path: String
§parameters: Vec<Parameter>
§

Data

§

Rset

§

Vrfy

This command asks the receiver to confirm that the argument identifies a user or mailbox. If it is a user name, information is returned as specified in Section 3.5.

This command has no effect on the reverse-path buffer, the forward- path buffer, or the mail data buffer.

Fields

§user_or_mailbox: AtomOrQuoted
§

Expn

This command asks the receiver to confirm that the argument identifies a mailing list, and if so, to return the membership of that list. If the command is successful, a reply is returned containing information as described in Section 3.5. This reply will have multiple lines except in the trivial case of a one-member list.

This command has no effect on the reverse-path buffer, the forward- path buffer, or the mail data buffer, and it may be issued at any time.

Fields

§mailing_list: AtomOrQuoted
§

Help

This command causes the server to send helpful information to the client. The command MAY take an argument (e.g., any command name) and return more specific information as a response.

SMTP servers SHOULD support HELP without arguments and MAY support it with arguments.

This command has no effect on the reverse-path buffer, the forward- path buffer, or the mail data buffer, and it may be issued at any time.

Fields

§

Noop

This command does not affect any parameters or previously entered commands. It specifies no action other than that the receiver send a “250 OK” reply.

If a parameter string is specified, servers SHOULD ignore it.

This command has no effect on the reverse-path buffer, the forward- path buffer, or the mail data buffer, and it may be issued at any time.

Fields

§

Quit

This command specifies that the receiver MUST send a “221 OK” reply, and then close the transmission channel.

The receiver MUST NOT intentionally close the transmission channel until it receives and replies to a QUIT command (even if there was an error). The sender MUST NOT intentionally close the transmission channel until it sends a QUIT command, and it SHOULD wait until it receives the reply (even if there was an error response to a previous command). If the connection is closed prematurely due to violations of the above or system or network failure, the server MUST cancel any pending transaction, but not undo any previously completed transaction, and generally MUST act as if the command or transaction in progress had received a temporary error (i.e., a 4yz response).

The QUIT command may be issued at any time. Any current uncompleted mail transaction will be aborted.

§

StartTLS

§

AuthLogin(Option<String>)

§

AuthPlain(Option<String>)

Implementations§

Source§

impl Command

Source

pub fn name(&self) -> &'static str

Source

pub fn serialize(&self, writer: &mut impl Write) -> Result<()>

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Command

Source§

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

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

impl PartialEq for Command

Source§

fn eq(&self, other: &Command) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Command

Source§

impl StructuralPartialEq for Command

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 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> ToOwned for T
where T: Clone,

Source§

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

Source§

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>,

Source§

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.