Trait Command

Source
pub trait Command:
    Clone
    + Debug
    + PartialEq
    + Eq {
    // Required methods
    fn write_payload(&self, write: &mut dyn Write) -> Result<(), Error>;
    fn read_payload(read: &mut dyn BufRead) -> Result<Self, Error>;
    fn command_name(&self) -> &'static str;

    // Provided methods
    fn write(&self, write: &mut dyn Write) -> Result<(), Error> { ... }
    fn bytes(&self) -> Vec<u8>  { ... }
    fn to_string(&self) -> String { ... }
}
Expand description

An FTP command.

Required Methods§

Source

fn write_payload(&self, write: &mut dyn Write) -> Result<(), Error>

Writes the payload data.

Source

fn read_payload(read: &mut dyn BufRead) -> Result<Self, Error>

Reads payload data.

Source

fn command_name(&self) -> &'static str

Gets the name of the command.

Provided Methods§

Source

fn write(&self, write: &mut dyn Write) -> Result<(), Error>

Writes the command to a buffer.

Source

fn bytes(&self) -> Vec<u8>

Source

fn to_string(&self) -> String

Generates the text string for this packet.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Command for ABOR

Source§

impl Command for CDUP

Source§

impl Command for EPSV

Source§

impl Command for FEAT

Source§

impl Command for NOOP

Source§

impl Command for PASV

Source§

impl Command for PWD

Source§

impl Command for QUIT

Source§

impl Command for REIN

Source§

impl Command for STOU

Source§

impl Command for SYST

Source§

impl Command for ACCT

Source§

impl Command for APPE

Source§

impl Command for CWD

Source§

impl Command for DELE

Source§

impl Command for HELP

Source§

impl Command for LIST

Source§

impl Command for MDTM

Source§

impl Command for MKD

Source§

impl Command for NLST

Source§

impl Command for PASS

Source§

impl Command for RETR

Source§

impl Command for RMD

Source§

impl Command for RNFR

Source§

impl Command for RNTO

Source§

impl Command for SITE

Source§

impl Command for SIZE

Source§

impl Command for STAT

Source§

impl Command for STOR

Source§

impl Command for TYPE

Source§

impl Command for USER

Source§

impl Command for MODE

Source§

impl Command for PORT

Source§

impl Command for ADAT

Source§

impl Command for AUTH

Source§

impl Command for CCC

Source§

impl Command for CONF

Source§

impl Command for ENC

Source§

impl Command for MIC

Source§

impl Command for PBSZ

Source§

impl Command for PROT

Source§

impl Command for ALLO

Source§

impl Command for EPRT

Source§

impl Command for HOST

Source§

impl Command for LANG

Source§

impl Command for LPRT

Source§

impl Command for LPSV

Source§

impl Command for MLSD

Source§

impl Command for MLST

Source§

impl Command for OPTS

Source§

impl Command for REST

Source§

impl Command for SMNT

Source§

impl Command for STRU

Source§

impl Command for XCUP

Source§

impl Command for XMKD

Source§

impl Command for XPWD

Source§

impl Command for XRCP

Source§

impl Command for XRMD

Source§

impl Command for XRSQ

Source§

impl Command for XSEM

Source§

impl Command for XSEN