pub enum Command {
Show 17 variants
Ehlo(Domain),
Helo(Domain),
Lhlo(Domain),
Noop(Option<String>),
Help(Option<String>),
Vrfy(Option<String>),
Expn(Option<String>),
Data,
DataDot,
Rset,
Quit,
StartTls,
MailFrom {
address: ReversePath,
parameters: Vec<EsmtpParameter>,
},
RcptTo {
address: ForwardPath,
parameters: Vec<EsmtpParameter>,
},
Auth {
sasl_mech: String,
initial_response: Option<String>,
},
XClient(Vec<XClientParameter>),
Unknown(BString),
}Variants§
Ehlo(Domain)
Helo(Domain)
Lhlo(Domain)
Noop(Option<String>)
Help(Option<String>)
Vrfy(Option<String>)
Expn(Option<String>)
Data
DataDot
The end-of-data terminator sent after the message body: ".\r\n".
This variant is never produced by the parser — it is constructed
programmatically by SMTP client code and serialized via
Command::encode when the client needs to signal the end of the
DATA content stream (RFC 5321 §4.5.2).
Rset
Quit
StartTls
MailFrom
RcptTo
Auth
XClient(Vec<XClientParameter>)
Unknown(BString)
Implementations§
Source§impl Command
impl Command
pub fn parse(input: impl AsRef<[u8]>) -> Result<MaybePartialCommand, String>
Sourcepub fn encode(&self) -> BString
pub fn encode(&self) -> BString
Re-encode the command as a single line of text ready to send on the
wire, including the trailing \r\n.
The returned BString can be fed back to Command::parse to
recover the original Command value (round-trip stable), with the
one intentional exception that at_domain_list source routes are not
re-emitted (RFC 5321 says they SHOULD NOT be generated).
Sourcepub fn client_timeout(&self, timeouts: &SmtpClientTimeouts) -> Duration
pub fn client_timeout(&self, timeouts: &SmtpClientTimeouts) -> Duration
Timeout for reading the response to this command.
Sourcepub fn client_timeout_request(&self, timeouts: &SmtpClientTimeouts) -> Duration
pub fn client_timeout_request(&self, timeouts: &SmtpClientTimeouts) -> Duration
Timeout for writing the request.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more