Struct protocol_ftp_client::FtpReceiver
[−]
[src]
pub struct FtpReceiver {
// some fields omitted
}"Passive" side of FTP protocol, which mean that receiver expects some data from remote server. As soon as it recieves enought data it can "advance" to transmitter state, i.e. fill buffer with commands to be furhter send to the remote server
Methods
impl FtpReceiver[src]
fn new() -> Self
fn try_advance(self, buffer: &[u8]) -> Result<FtpTransmitter, Self>
Try to consume Reciver by parsing buffer and andvacne into Transmitter.
In the case of error, it returns unmodified Reciver as the error. The
actually happen error can be obtatied via take_error
In case of success it remembers the last successfull state, probably switches
it and returns Transmitter object
fn take_error(&mut self) -> Option<FtpError>
Returns tha last occurred error, and internally
sets up None
fn to_transmitter(self) -> FtpTransmitter
Sometimes you need manually advance to Transmitter
e.g. in case of Authorization Error, you can re-send
other credentials