#[non_exhaustive]pub enum StunParseError {
NotStun,
Truncated {
expected: usize,
actual: usize,
},
TooLarge {
expected: usize,
actual: usize,
},
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
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 Clone for StunParseError
impl Clone for StunParseError
Source§fn clone(&self) -> StunParseError
fn clone(&self) -> StunParseError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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()
Source§impl From<StunParseError> for ValidateError
impl From<StunParseError> for ValidateError
Source§fn from(value: StunParseError) -> Self
fn from(value: StunParseError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for StunParseError
impl PartialEq for StunParseError
impl Copy for StunParseError
impl Eq for StunParseError
impl StructuralPartialEq for StunParseError
Auto Trait Implementations§
impl Freeze for StunParseError
impl RefUnwindSafe for StunParseError
impl Send for StunParseError
impl Sync for StunParseError
impl Unpin for StunParseError
impl UnsafeUnpin 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