#[non_exhaustive]pub enum BuildError {
LengthOverflow {
context: &'static str,
maximum: usize,
actual: usize,
},
ValueOutOfRange {
context: &'static str,
maximum: usize,
actual: usize,
},
LengthTooShort {
context: &'static str,
minimum: usize,
actual: usize,
},
InvalidFieldLength {
context: &'static str,
expected: usize,
actual: usize,
},
AddressFamilyMismatch {
context: &'static str,
},
SerializationFailed {
context: &'static str,
},
}Expand description
Error returned when packet builder inputs cannot be encoded safely.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
LengthOverflow
A packet field cannot represent the supplied number of bytes.
Fields
ValueOutOfRange
A numeric protocol field is outside its representable range.
Fields
LengthTooShort
A variable-size field is shorter than the protocol minimum.
Fields
InvalidFieldLength
A fixed-size field has an unexpected length.
Fields
AddressFamilyMismatch
Source and destination addresses cannot form a checksum pseudo-header.
SerializationFailed
An internally assembled packet could not be decoded.
Trait Implementations§
Source§impl Clone for BuildError
impl Clone for BuildError
Source§impl Debug for BuildError
impl Debug for BuildError
Source§impl Display for BuildError
impl Display for BuildError
impl Eq for BuildError
Source§impl Error for BuildError
impl Error for BuildError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for BuildError
impl PartialEq for BuildError
impl StructuralPartialEq for BuildError
Auto Trait Implementations§
impl Forget for BuildError
impl Freeze for BuildError
impl Move for BuildError
impl RefUnwindSafe for BuildError
impl Send for BuildError
impl Sync for BuildError
impl Unpin for BuildError
impl UnsafeUnpin for BuildError
impl UnwindSafe for BuildError
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