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§
Sourcefn read_payload(read: &mut dyn BufRead) -> Result<Self, Error>
fn read_payload(read: &mut dyn BufRead) -> Result<Self, Error>
Reads payload data.
Sourcefn command_name(&self) -> &'static str
fn command_name(&self) -> &'static str
Gets the name of the command.
Provided Methods§
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.