[][src]Trait new_tokio_smtp::Cmd

pub trait Cmd: Send + 'static {
    fn check_cmd_availability(
        &self,
        caps: Option<&EhloData>
    ) -> Result<(), MissingCapabilities>;
fn exec(self, io: Io) -> ExecFuture; fn boxed(self) -> BoxedCmd
    where
        Self: Sized + 'static
, { ... } }

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>

This method is used to verify if the command can be used for a given connection

fn exec(self, io: Io) -> ExecFuture

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:

  1. send does use check_cmd_availability, so exec should not do so as it's unnecessary
  2. send turns the Io instance the returned future resolves to back into a Connection instance
Loading content...

Provided methods

fn boxed(self) -> BoxedCmd where
    Self: Sized + '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)

Loading content...

Implementations on Foreign Types

impl Cmd for Arc<Plain>[src]

Loading content...

Implementors

impl Cmd for Login[src]

impl Cmd for Plain[src]

impl Cmd for Ehlo[src]

impl Cmd for Help[src]

impl Cmd for Mail[src]

impl Cmd for Noop[src]

impl Cmd for Recipient[src]

impl Cmd for Reset[src]

impl Cmd for Verify[src]

impl Cmd for BoxedCmd[src]

impl<A, B> Cmd for EitherCmd<A, B> where
    A: Cmd,
    B: Cmd
[src]

impl<A, B> Cmd for SelectCmd<A, B> where
    A: Cmd,
    B: Cmd
[src]

impl<S> Cmd for StartTls<S> where
    S: SetupTls
[src]

impl<S: 'static> Cmd for Data<S> where
    S: Stream<Error = Error> + Send,
    S::Item: Buf
[src]

Loading content...