#[repr(u16)]pub enum ErrorCode {
NotDefined = 0,
FileNotFound = 1,
AccessViolation = 2,
DiskFull = 3,
IllegalOperation = 4,
UnknownId = 5,
FileExists = 6,
NoSuchUser = 7,
RefusedOption = 8,
}Expand description
ErrorCode enum represents the error codes used in the TFTP definition.
This enum has function implementations for converting u16s to
ErrorCodes and ErrorCodes to u8 arrays.
§Example
use tftpd::ErrorCode;
assert_eq!(ErrorCode::from_u16(3).unwrap(), ErrorCode::DiskFull);
assert_eq!(ErrorCode::FileExists.as_bytes(), [0x00, 0x06]);Variants§
NotDefined = 0
Not Defined error code
FileNotFound = 1
File not found error code
AccessViolation = 2
Access violation error code
DiskFull = 3
Disk full error code
IllegalOperation = 4
Illegal operation error code
UnknownId = 5
Unknown ID error code
FileExists = 6
File exists error code
NoSuchUser = 7
No such user error code
RefusedOption = 8
Refused option error code
Implementations§
Trait Implementations§
impl Copy for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
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