pub struct FixedBuffer(/* private fields */);Expand description
An opaque buffer representing arbitrary data given to us by libvpx
in a returned Packet. You can access the underlying data by calling
the unsafe [FixedBuffer::get_inner()] method with the appropriate
return type. If the libvpx buffer is null, this type will never be
constructed, so if you see a FixedBuffer, you can be sure that
there is something there.
Implementations§
Source§impl FixedBuffer
impl FixedBuffer
Sourcepub unsafe fn inner<T: Sized>(&self) -> Option<&T>
pub unsafe fn inner<T: Sized>(&self) -> Option<&T>
Unsafely casts the pointer contained in the fixed buffer to a reference of the return type of this function.
§Safety
We cannot fully check what type the contained data is, so it is up to the caller to make sure they’re only grabbing the correct type here. This function only checks that the size of the buffer target matches the return type’s size.
Trait Implementations§
Source§impl Clone for FixedBuffer
impl Clone for FixedBuffer
Source§fn clone(&self) -> FixedBuffer
fn clone(&self) -> FixedBuffer
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 FixedBuffer
impl Debug for FixedBuffer
Source§impl Hash for FixedBuffer
impl Hash for FixedBuffer
Source§impl Ord for FixedBuffer
impl Ord for FixedBuffer
Source§fn cmp(&self, other: &FixedBuffer) -> Ordering
fn cmp(&self, other: &FixedBuffer) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FixedBuffer
impl PartialEq for FixedBuffer
Source§impl PartialOrd for FixedBuffer
impl PartialOrd for FixedBuffer
impl Eq for FixedBuffer
impl StructuralPartialEq for FixedBuffer
Auto Trait Implementations§
impl Freeze for FixedBuffer
impl RefUnwindSafe for FixedBuffer
impl Send for FixedBuffer
impl Sync for FixedBuffer
impl Unpin for FixedBuffer
impl UnwindSafe for FixedBuffer
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