#[non_exhaustive]pub enum Error {
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
InvalidVersion(u8),
InvalidValue {
field: &'static str,
value: u64,
reason: &'static str,
},
InvalidPadding {
count: u8,
reason: &'static str,
},
ExtensionNotWordAligned {
data_len: usize,
},
NotRfc8285Extension {
profile_id: u16,
},
InvalidOneByteExtensionId(u8),
InvalidTwoByteExtensionId,
}Expand description
An RTP header parse / serialize error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooShort
Input (on parse) or output buffer (on serialize) shorter than required.
Fields
InvalidVersion(u8)
The 2-bit version field was not 2 (RFC 3550 §5.1: “The version
defined by this specification is two (2)”).
InvalidValue
A field value did not fit its wire bit-width, or a derived count (CSRC list length, extension word count, padding octet count) overflowed its field.
Fields
InvalidPadding
The padding region (RFC 3550 §5.1) was malformed: either the trailing count byte was zero, exceeded the bytes actually available, or (on serialize) a supplied padding slice’s last byte did not equal its own length.
Fields
ExtensionNotWordAligned
A header-extension data slice’s length was not a multiple of 4 bytes
— RFC 3550 §5.3.1’s length field counts whole 32-bit words.
NotRfc8285Extension
rfc8285 only.(rfc8285 feature) A HeaderExtension’s
profile_id matched neither the RFC 8285 one-byte form (0xBEDE) nor
the two-byte form (profile_id & 0xFFF0 == 0x1000). This is not a
malformed-packet error: RFC 8285 interpretation of the RFC 3550
§5.3.1 opaque extension data is profile-scoped and opt-in, so an
extension with some other profile_id is simply not one this crate’s
rfc8285 decoder understands.
InvalidOneByteExtensionId(u8)
rfc8285 only.(rfc8285 feature) An RFC 8285 one-byte-form local identifier was
outside the valid 1..=14 range (§4.2: 0 is reserved for padding, 15
is reserved for a future extension / used as the “stop” marker).
InvalidTwoByteExtensionId
rfc8285 only.(rfc8285 feature) An RFC 8285 two-byte-form local identifier was 0
(§4.1.2 / §5: “0 is reserved for padding in both forms”).
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()