Skip to main content

CompressedRef

Struct CompressedRef 

Source
pub struct CompressedRef<'rx, F: PacketFormat> { /* private fields */ }
Expand description

A borrowed compressed packet captured by a PacketReceiver.

Capture validates once without allocating. The receive guard retains payload and metadata, including an application allocator’s usage charge, until the reference drops. Copy into an owned frame before sending because the SDK can write to frames it sends.

Implementations§

Source§

impl<'rx, F: PacketFormat> CompressedRef<'rx, F>

Source

pub fn data(&self) -> &[u8] ⓘ

The complete codec bytes, borrowed in place.

Source

pub fn format(&self) -> F

The packet’s codec and media format.

Source

pub fn timecode(&self) -> Timecode

The timecode supplied by the source.

Source

pub fn timestamp(&self) -> Option<ReceivedTimestamp>

Source-dependent timestamp supplied by the SDK at capture.

Source

pub fn metadata(&self) -> Option<&str>

Optional UTF-8 metadata. Self::metadata_status reports withheld text.

Source

pub fn metadata_status(&self) -> FrameMetadataStatus

Cached metadata presence or the reason unreadable text was withheld.

Source

pub fn envelope(&self) -> Option<PacketEnvelope<'_>>

The validated envelope, if the codec uses one.

Source

pub fn to_owned(&self) -> ReceivedPacket<F>

Copy payload and readable metadata into independent storage, retaining the status of any withheld metadata.

Source

pub fn copy_into(&self, destination: &mut ReceivedPacket<F>)

Make a lossless copy into existing storage. Once the destination has sufficient capacity, repeated copies allocate nothing.

Source

pub fn try_copy_into(&self, destination: &mut CompressedFrame<F>) -> Result<()>

Admit this packet for sending, then copy it into existing storage. A refusal leaves every destination field and allocation unchanged.

§Errors

Error::InvalidFrame when this packet cannot be sent.

Trait Implementations§

Source§

impl<F: PacketFormat> Debug for CompressedRef<'_, F>

Source§

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

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

impl<F: PacketFormat> TryFrom<&CompressedRef<'_, F>> for CompressedFrame<F>

Source§

type Error = Error

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

fn try_from(packet: &CompressedRef<'_, F>) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

§

impl<'rx, F> !Send for CompressedRef<'rx, F>

§

impl<'rx, F> !Sync for CompressedRef<'rx, F>

§

impl<'rx, F> Freeze for CompressedRef<'rx, F>
where <<F as NativePacketFormat>::Kind as FrameFree>::Instance: Freeze, <F as NativePacketFormat>::Descriptor: Freeze, F: Freeze,

§

impl<'rx, F> RefUnwindSafe for CompressedRef<'rx, F>
where <<F as NativePacketFormat>::Kind as FrameFree>::Instance: RefUnwindSafe, <F as NativePacketFormat>::Descriptor: RefUnwindSafe, F: RefUnwindSafe,

§

impl<'rx, F> Unpin for CompressedRef<'rx, F>
where <<F as NativePacketFormat>::Kind as FrameFree>::Instance: Unpin, <F as NativePacketFormat>::Descriptor: Unpin, F: Unpin,

§

impl<'rx, F> UnsafeUnpin for CompressedRef<'rx, F>
where <<F as NativePacketFormat>::Kind as FrameFree>::Instance: UnsafeUnpin, <F as NativePacketFormat>::Descriptor: UnsafeUnpin, F: UnsafeUnpin,

§

impl<'rx, F> UnwindSafe for CompressedRef<'rx, F>
where <<F as NativePacketFormat>::Kind as FrameFree>::Instance: UnwindSafe, <F as NativePacketFormat>::Descriptor: UnwindSafe, F: UnwindSafe,

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.