Skip to main content

PacketBufferError

Enum PacketBufferError 

Source
pub enum PacketBufferError {
    Refcount(Refcount),
    Bounds(Bounds),
    SideDataEntries(SideDataEntries),
    SideDataArray(SideDataArray),
    SideDataPayload(SideDataPayload),
    SideDataBytes(SideDataBytes),
    UnrepresentableFlags(UnrepresentableFlags),
    SideDataAlloc(SideDataAlloc),
}
Expand description

Why a packet could not be carried across the boundary — its payload, or the side data that comes with it.

Every arm means the bytes are real and this crate could not carry them — never that there were none. “No payload” is Ok(None) from FfmpegBuffer::from_packet, and keeping the two apart is the whole point of the type: a demuxer that reads a refcount failure as an empty marker drops a video packet under memory pressure and carries on as though the file said so. The side-data arms exist for the same reason one tier along — a packet whose side data cannot be carried whole is refused, never delivered with some of it.

Variants§

§

Refcount(Refcount)

av_buffer_ref returned null — out of memory taking a second reference to a payload that is there.

§

Bounds(Bounds)

The payload does not lie inside the packet’s own buffer.

§

SideDataEntries(SideDataEntries)

A packet declares more side-data entries than this crate will walk, or a negative count.

§

SideDataArray(SideDataArray)

A packet declares side-data entries and carries no array to read them from.

§

SideDataPayload(SideDataPayload)

A side-data entry declares bytes it does not carry.

§

SideDataBytes(SideDataBytes)

A packet’s side data is larger than this crate will copy.

§

UnrepresentableFlags(UnrepresentableFlags)

A packet carries flag bits the portable vocabulary cannot hold.

§

SideDataAlloc(SideDataAlloc)

Out of memory copying a side-data entry.

Implementations§

Source§

impl PacketBufferError

Source

pub const fn is_refcount(&self) -> bool

Returns true if this value is of type Refcount. Returns false otherwise

Source

pub const fn is_bounds(&self) -> bool

Returns true if this value is of type Bounds. Returns false otherwise

Source

pub const fn is_side_data_entries(&self) -> bool

Returns true if this value is of type SideDataEntries. Returns false otherwise

Source

pub const fn is_side_data_array(&self) -> bool

Returns true if this value is of type SideDataArray. Returns false otherwise

Source

pub const fn is_side_data_payload(&self) -> bool

Returns true if this value is of type SideDataPayload. Returns false otherwise

Source

pub const fn is_side_data_bytes(&self) -> bool

Returns true if this value is of type SideDataBytes. Returns false otherwise

Source

pub const fn is_unrepresentable_flags(&self) -> bool

Returns true if this value is of type UnrepresentableFlags. Returns false otherwise

Source

pub const fn is_side_data_alloc(&self) -> bool

Returns true if this value is of type SideDataAlloc. Returns false otherwise

Source§

impl PacketBufferError

Source

pub fn unwrap_refcount(self) -> Refcount

Unwraps this value to the PacketBufferError::Refcount variant. Panics if this value is of any other type.

Source

pub fn unwrap_refcount_ref(&self) -> &Refcount

Unwraps this reference to the PacketBufferError::Refcount variant. Panics if this value is of any other type.

Source

pub fn unwrap_refcount_mut(&mut self) -> &mut Refcount

Unwraps this mutable reference to the PacketBufferError::Refcount variant. Panics if this value is of any other type.

Source

pub fn unwrap_bounds(self) -> Bounds

Unwraps this value to the PacketBufferError::Bounds variant. Panics if this value is of any other type.

Source

pub fn unwrap_bounds_ref(&self) -> &Bounds

Unwraps this reference to the PacketBufferError::Bounds variant. Panics if this value is of any other type.

Source

pub fn unwrap_bounds_mut(&mut self) -> &mut Bounds

Unwraps this mutable reference to the PacketBufferError::Bounds variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_entries(self) -> SideDataEntries

Unwraps this value to the PacketBufferError::SideDataEntries variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_entries_ref(&self) -> &SideDataEntries

Unwraps this reference to the PacketBufferError::SideDataEntries variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_entries_mut(&mut self) -> &mut SideDataEntries

Unwraps this mutable reference to the PacketBufferError::SideDataEntries variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_array(self) -> SideDataArray

Unwraps this value to the PacketBufferError::SideDataArray variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_array_ref(&self) -> &SideDataArray

Unwraps this reference to the PacketBufferError::SideDataArray variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_array_mut(&mut self) -> &mut SideDataArray

Unwraps this mutable reference to the PacketBufferError::SideDataArray variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_payload(self) -> SideDataPayload

Unwraps this value to the PacketBufferError::SideDataPayload variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_payload_ref(&self) -> &SideDataPayload

Unwraps this reference to the PacketBufferError::SideDataPayload variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_payload_mut(&mut self) -> &mut SideDataPayload

Unwraps this mutable reference to the PacketBufferError::SideDataPayload variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_bytes(self) -> SideDataBytes

Unwraps this value to the PacketBufferError::SideDataBytes variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_bytes_ref(&self) -> &SideDataBytes

Unwraps this reference to the PacketBufferError::SideDataBytes variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_bytes_mut(&mut self) -> &mut SideDataBytes

Unwraps this mutable reference to the PacketBufferError::SideDataBytes variant. Panics if this value is of any other type.

Source

pub fn unwrap_unrepresentable_flags(self) -> UnrepresentableFlags

Unwraps this value to the PacketBufferError::UnrepresentableFlags variant. Panics if this value is of any other type.

Source

pub fn unwrap_unrepresentable_flags_ref(&self) -> &UnrepresentableFlags

Unwraps this reference to the PacketBufferError::UnrepresentableFlags variant. Panics if this value is of any other type.

Source

pub fn unwrap_unrepresentable_flags_mut(&mut self) -> &mut UnrepresentableFlags

Unwraps this mutable reference to the PacketBufferError::UnrepresentableFlags variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_alloc(self) -> SideDataAlloc

Unwraps this value to the PacketBufferError::SideDataAlloc variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_alloc_ref(&self) -> &SideDataAlloc

Unwraps this reference to the PacketBufferError::SideDataAlloc variant. Panics if this value is of any other type.

Source

pub fn unwrap_side_data_alloc_mut(&mut self) -> &mut SideDataAlloc

Unwraps this mutable reference to the PacketBufferError::SideDataAlloc variant. Panics if this value is of any other type.

Source§

impl PacketBufferError

Source

pub fn try_unwrap_refcount(self) -> Result<Refcount, TryUnwrapError<Self>>

Attempts to unwrap this value to the PacketBufferError::Refcount variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_refcount_ref( &self, ) -> Result<&Refcount, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the PacketBufferError::Refcount variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_refcount_mut( &mut self, ) -> Result<&mut Refcount, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the PacketBufferError::Refcount variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_bounds(self) -> Result<Bounds, TryUnwrapError<Self>>

Attempts to unwrap this value to the PacketBufferError::Bounds variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_bounds_ref(&self) -> Result<&Bounds, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the PacketBufferError::Bounds variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_bounds_mut( &mut self, ) -> Result<&mut Bounds, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the PacketBufferError::Bounds variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_entries( self, ) -> Result<SideDataEntries, TryUnwrapError<Self>>

Attempts to unwrap this value to the PacketBufferError::SideDataEntries variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_entries_ref( &self, ) -> Result<&SideDataEntries, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the PacketBufferError::SideDataEntries variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_entries_mut( &mut self, ) -> Result<&mut SideDataEntries, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the PacketBufferError::SideDataEntries variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_array( self, ) -> Result<SideDataArray, TryUnwrapError<Self>>

Attempts to unwrap this value to the PacketBufferError::SideDataArray variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_array_ref( &self, ) -> Result<&SideDataArray, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the PacketBufferError::SideDataArray variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_array_mut( &mut self, ) -> Result<&mut SideDataArray, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the PacketBufferError::SideDataArray variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_payload( self, ) -> Result<SideDataPayload, TryUnwrapError<Self>>

Attempts to unwrap this value to the PacketBufferError::SideDataPayload variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_payload_ref( &self, ) -> Result<&SideDataPayload, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the PacketBufferError::SideDataPayload variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_payload_mut( &mut self, ) -> Result<&mut SideDataPayload, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the PacketBufferError::SideDataPayload variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_bytes( self, ) -> Result<SideDataBytes, TryUnwrapError<Self>>

Attempts to unwrap this value to the PacketBufferError::SideDataBytes variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_bytes_ref( &self, ) -> Result<&SideDataBytes, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the PacketBufferError::SideDataBytes variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_bytes_mut( &mut self, ) -> Result<&mut SideDataBytes, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the PacketBufferError::SideDataBytes variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_unrepresentable_flags( self, ) -> Result<UnrepresentableFlags, TryUnwrapError<Self>>

Attempts to unwrap this value to the PacketBufferError::UnrepresentableFlags variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_unrepresentable_flags_ref( &self, ) -> Result<&UnrepresentableFlags, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the PacketBufferError::UnrepresentableFlags variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_unrepresentable_flags_mut( &mut self, ) -> Result<&mut UnrepresentableFlags, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the PacketBufferError::UnrepresentableFlags variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_alloc( self, ) -> Result<SideDataAlloc, TryUnwrapError<Self>>

Attempts to unwrap this value to the PacketBufferError::SideDataAlloc variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_alloc_ref( &self, ) -> Result<&SideDataAlloc, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the PacketBufferError::SideDataAlloc variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_side_data_alloc_mut( &mut self, ) -> Result<&mut SideDataAlloc, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the PacketBufferError::SideDataAlloc variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Trait Implementations§

Source§

impl Clone for PacketBufferError

Source§

fn clone(&self) -> PacketBufferError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PacketBufferError

Source§

impl Debug for PacketBufferError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PacketBufferError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PacketBufferError

Source§

impl Error for PacketBufferError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for PacketBufferError

Source§

fn eq(&self, other: &PacketBufferError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PacketBufferError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more