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>
impl<'rx, F: PacketFormat> CompressedRef<'rx, F>
Sourcepub fn timestamp(&self) -> Option<ReceivedTimestamp>
pub fn timestamp(&self) -> Option<ReceivedTimestamp>
Source-dependent timestamp supplied by the SDK at capture.
Sourcepub fn metadata(&self) -> Option<&str>
pub fn metadata(&self) -> Option<&str>
Optional UTF-8 metadata. Self::metadata_status reports withheld text.
Sourcepub fn metadata_status(&self) -> FrameMetadataStatus
pub fn metadata_status(&self) -> FrameMetadataStatus
Cached metadata presence or the reason unreadable text was withheld.
Sourcepub fn envelope(&self) -> Option<PacketEnvelope<'_>>
pub fn envelope(&self) -> Option<PacketEnvelope<'_>>
The validated envelope, if the codec uses one.
Sourcepub fn to_owned(&self) -> ReceivedPacket<F>
pub fn to_owned(&self) -> ReceivedPacket<F>
Copy payload and readable metadata into independent storage, retaining the status of any withheld metadata.
Sourcepub fn copy_into(&self, destination: &mut ReceivedPacket<F>)
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.
Sourcepub fn try_copy_into(&self, destination: &mut CompressedFrame<F>) -> Result<()>
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.