[−][src]Trait mail_smtp::misc::Cmd
Trait implemented by any smtp command
While it is not object safe on itself using
cmd.boxed()
provides something very similar
to trait object.
Required methods
fn check_cmd_availability(
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
This method is used to verify if the command can be used for a given connection
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
Executes this command on the given connection
This method should not be called directly, instead it
is called by Connection.send
. Which calls this method
with two addition:
- send does use
check_cmd_availability
, soexec
should not do so as it's unnecessary - send turns the
Io
instance the returned future resolves to back into aConnection
instance
Provided methods
fn boxed(self) -> Box<dyn TypeErasableCmd + 'static + Send> where
Self: 'static,
Self: 'static,
Turns the command into a BoxedCmd
BoxedCmd
isn't a trait object of Cmd
but
it's similar to it and implements Cmd
. Use this
if you would normally use a Cmd
trait object.
(e.g. to but a number of cmd's in a Vec
)
Implementations on Foreign Types
impl Cmd for Ehlo
[src]
fn check_cmd_availability(
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl Cmd for Verify
[src]
fn check_cmd_availability(
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl Cmd for Noop
[src]
fn check_cmd_availability(
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl Cmd for Help
[src]
fn check_cmd_availability(
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl Cmd for Arc<Plain>
[src]
fn check_cmd_availability(
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl<A, B> Cmd for EitherCmd<A, B> where
A: Cmd,
B: Cmd,
[src]
A: Cmd,
B: Cmd,
fn check_cmd_availability(
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl Cmd for Reset
[src]
fn check_cmd_availability(
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl Cmd for Box<dyn TypeErasableCmd + 'static + Send>
[src]
fn check_cmd_availability(
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl<S> Cmd for Data<S> where
S: 'static + Stream<Error = Error> + Send,
<S as Stream>::Item: Buf,
[src]
S: 'static + Stream<Error = Error> + Send,
<S as Stream>::Item: Buf,
fn check_cmd_availability(
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl<A, B> Cmd for SelectCmd<A, B> where
A: Cmd,
B: Cmd,
[src]
A: Cmd,
B: Cmd,
fn check_cmd_availability(
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl Cmd for Recipient
[src]
fn check_cmd_availability(
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl<S> Cmd for StartTls<S> where
S: SetupTls,
[src]
S: SetupTls,
fn check_cmd_availability(
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
impl Cmd for Mail
[src]
fn check_cmd_availability(
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
_caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
con: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
Implementors
impl Cmd for Login
[src]
fn check_cmd_availability(
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
[src]
&self,
caps: Option<&EhloData>
) -> Result<(), MissingCapabilities>
fn exec(
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>
[src]
self,
io: Io
) -> Box<dyn Future<Item = (Io, Result<Response, LogicError>), Error = Error> + 'static + Send>