pub enum Error {
InvalidOpCode(u16),
InvalidTransferMode(String),
InvalidErrorCode(u16),
InvalidOptions(String),
ReadError(Error),
WriteError(Error),
}Expand description
An error reading, parsing, or writing a packet.
Variants§
InvalidOpCode(u16)
The operation is invalid / not recognised.
InvalidTransferMode(String)
The transfer mode is invalid / not recognised.
InvalidErrorCode(u16)
The error code is invalid / not recognised.
InvalidOptions(String)
The options are invalid / not recognised.
Okay, perhaps not recognised is not appropriate here, because
the TFTP RFCs state that unrecognised options should be ignored.
Only recognised options are ackowledged in an OACK packet,
meaning that both sides know the options that the other side
understands and does not understand before the transfer begins.
ReadError(Error)
A packet could not be read / deserialised.
WriteError(Error)
A packet could not be written / serialised.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more