#[non_exhaustive]pub enum StunParseError {
NotStun,
Truncated {
expected: usize,
actual: usize,
},
TooLarge {
expected: usize,
actual: usize,
},
IntegrityCheckFailed,
MissingAttribute(AttributeType),
AttributeAfterIntegrity(AttributeType),
AttributeAfterFingerprint(AttributeType),
FingerprintMismatch,
DataMismatch,
InvalidAttributeData,
WrongAttributeImplementation,
}Expand description
Possible errors when parsing a STUN message.
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.
NotStun
Not a STUN message.
Truncated
The message has been truncated
TooLarge
The message has been truncated
IntegrityCheckFailed
Integrity value does not match computed value
MissingAttribute(AttributeType)
An attribute was not found in the message
AttributeAfterIntegrity(AttributeType)
An attribute was found after the message integrity attribute
AttributeAfterFingerprint(AttributeType)
An attribute was found after the message integrity attribute
FingerprintMismatch
Fingerprint does not match the data.
DataMismatch
The provided data does not match the message
InvalidAttributeData
The attribute contains invalid data
WrongAttributeImplementation
The attribute does not parse this data
Trait Implementations§
Source§impl Debug for StunParseError
impl Debug for StunParseError
Source§impl Display for StunParseError
impl Display for StunParseError
Source§impl Error for StunParseError
impl Error for StunParseError
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()
Auto Trait Implementations§
impl Freeze for StunParseError
impl RefUnwindSafe for StunParseError
impl Send for StunParseError
impl Sync for StunParseError
impl Unpin for StunParseError
impl UnwindSafe for StunParseError
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