Enum stun_coder::MessageDecodeError[][src]

pub enum MessageDecodeError {
    ReadFailure(Error),
    HeaderDecodeFailure(HeaderDecodeError),
    AttributeDecodeFailure(AttributeDecodeError),
    IntegrityKeyGenerationFailure(IntegrityKeyGenerationError),
    IncorrectFingerprintAttributePosition {
        msg_len: usize,
        attr_pos: usize,
    },
    FingerprintMismatch {
        attr_value: u32,
        computed_value: u32,
    },
    MessageIntegrityFail {
        attr_value: Vec<u8>,
        computed_value: Vec<u8>,
    },
}
Expand description

Message encoding errors.

Variants

ReadFailure

IO error when reading a field value

Tuple Fields of ReadFailure

0: Error
HeaderDecodeFailure

Failure to decode the STUN header section

Tuple Fields of HeaderDecodeFailure

0: HeaderDecodeError
AttributeDecodeFailure

Failure to decode a STUN attribute

Tuple Fields of AttributeDecodeFailure

0: AttributeDecodeError
IntegrityKeyGenerationFailure

Failure to generate an integrity verification key

Tuple Fields of IntegrityKeyGenerationFailure

0: IntegrityKeyGenerationError
IncorrectFingerprintAttributePosition

Fingerprint attribute is not the last one. This can mean that either the provided byte data contains more than only the STUN message, or message integrity has been compromised.

Fields of IncorrectFingerprintAttributePosition

msg_len: usize

STUN message length

attr_pos: usize

Fingerprint attribute position in that message

FingerprintMismatch

Stored and calculated fingerprints mismatch. Means that the message integrity has been compromised.

Fields of FingerprintMismatch

attr_value: u32

Provided CRC32 value

computed_value: u32

Computed CRC32 value

MessageIntegrityFail

The calculated HMAC value doesn’t match with the provided one. Either the provided integrity_key is incorrect or the message integrity has been compromised.

Fields of MessageIntegrityFail

attr_value: Vec<u8>

Provided HMAC

computed_value: Vec<u8>

Calculated HMAC

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.