#[non_exhaustive]pub enum ServerEvent {
Request {
name: Vec<u8>,
},
FileStart {
name: Vec<u8>,
sending: bool,
},
Progress {
done: u64,
total: Option<u64>,
},
Received {
name: Vec<u8>,
data: Vec<u8>,
},
Discarded {
name: Vec<u8>,
},
Sent {
name: Vec<u8>,
},
Remote(Vec<u8>),
Error(Error),
Done,
}Expand description
Something that happened on the server’s side of the link.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Request
The client asks for a file (R). Answer with Server::serve or
Server::refuse; the server waits for the answer.
FileStart
A file starts: one we serve (the name from the client’s ACK to F, else ours) or one the client sends (its F packet).
Progress
Bytes of the current file acknowledged (send) or received.
Fields
Received
A file the client sent is complete.
Discarded
The client discarded the file it was sending (Z with D).
Sent
The file we served is acknowledged to its end (its Z).
Remote(Vec<u8>)
An E packet from the client, with its decoded text. Ends a running
transaction; also the client’s answer to Server::refuse.
Error(Error)
A transaction failed on our side (timeout, protocol, too large, cancelled); an E packet went out where one makes sense.
Done
A transaction ended normally (its B acknowledged).