pub struct ReceivedPacket<F: PacketFormat> { /* private fields */ }Expand description
An owned compressed packet copied from a receiver without loss.
Later envelope versions, flags and trailing bytes remain intact. Convert
with CompressedFrame::try_from before sending. A refusal returns this
packet and its storage in Rejected.
Implementations§
Source§impl<F: PacketFormat> ReceivedPacket<F>
impl<F: PacketFormat> ReceivedPacket<F>
Sourcepub fn timecode(&self) -> Timecode
pub fn timecode(&self) -> Timecode
The timecode: crate::Timecode::SYNTHESIZE on a frame built for
sending without an explicit timecode.
Sourcepub fn set_timecode(&mut self, timecode: Timecode)
pub fn set_timecode(&mut self, timecode: Timecode)
Replace the frame’s timecode.
Sourcepub fn metadata(&self) -> Option<&str>
pub fn metadata(&self) -> Option<&str>
The per-frame metadata, if any. Unreadable received text is omitted.
Sourcepub fn metadata_status(&self) -> FrameMetadataStatus
pub fn metadata_status(&self) -> FrameMetadataStatus
Cached metadata presence or the reason unreadable text was withheld.
Sourcepub fn set_metadata(
&mut self,
metadata: impl Into<String>,
) -> Result<(), Rejected<String>>
pub fn set_metadata( &mut self, metadata: impl Into<String>, ) -> Result<(), Rejected<String>>
Replace frame metadata. Use Self::clear_metadata to remove it.
Invalid replacement text leaves the existing metadata unchanged.
§Errors
Returns the unchanged text in crate::Rejected, with
crate::Error::InvalidCString for an interior NUL, or
crate::Error::InvalidFrame when the emitted C string would
exceed the metadata size cap. NulError retains only the prefix
through the first NUL; crate::Rejected::into_inner returns all text.
Sourcepub fn clear_metadata(&mut self)
pub fn clear_metadata(&mut self)
Remove the frame metadata.
Sourcepub fn data(&self) -> &[u8] ⓘ
pub fn data(&self) -> &[u8] ⓘ
The complete codec bytes, including retained envelope extensions.
Sourcepub fn timestamp(&self) -> Option<ReceivedTimestamp>
pub fn timestamp(&self) -> Option<ReceivedTimestamp>
Source-dependent timestamp supplied by the SDK at capture.
Sourcepub fn envelope(&self) -> Option<PacketEnvelope<'_>>
pub fn envelope(&self) -> Option<PacketEnvelope<'_>>
The validated envelope, if the codec uses one.
Sourcepub fn validate_for_send(&self) -> Result<()>
pub fn validate_for_send(&self) -> Result<()>
Check send admission without consuming or changing this packet.
§Errors
Error::InvalidFrame for unsupported codec parameters or envelope details.