#[non_exhaustive]pub enum PacketError {
Empty,
FrameTooLarge,
Code1UnevenPayload,
InvalidFrameLength,
InvalidFrameCount,
InvalidPadding,
CbrPayloadNotDivisible,
}Expand description
Why a packet failed to parse; each variant names the RFC 6716 §3.4 requirement it violates.
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.
Empty
The packet is empty [R1].
FrameTooLarge
An implicit frame length exceeds MAX_FRAME_LEN [R2].
Code1UnevenPayload
A code 1 packet’s payload is not evenly divisible in two [R3].
InvalidFrameLength
A frame-length field is truncated or overruns the remaining payload [R4][R7].
InvalidFrameCount
A code 3 packet signals zero frames, or more than 120 ms of audio [R5].
InvalidPadding
A code 3 packet’s padding overruns the packet [R6][R7].
CbrPayloadNotDivisible
A CBR code 3 packet’s payload is not an exact multiple of the frame count [R6].
Trait Implementations§
Source§impl Clone for PacketError
impl Clone for PacketError
Source§fn clone(&self) -> PacketError
fn clone(&self) -> PacketError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PacketError
Source§impl Debug for PacketError
impl Debug for PacketError
Source§impl Display for PacketError
impl Display for PacketError
impl Eq for PacketError
Source§impl Error for PacketError
Available on crate feature std only.
impl Error for PacketError
Available on crate feature
std only.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 PacketError
impl PartialEq for PacketError
Source§fn eq(&self, other: &PacketError) -> bool
fn eq(&self, other: &PacketError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PacketError
Auto Trait Implementations§
impl Freeze for PacketError
impl RefUnwindSafe for PacketError
impl Send for PacketError
impl Sync for PacketError
impl Unpin for PacketError
impl UnsafeUnpin for PacketError
impl UnwindSafe for PacketError
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