pub struct Packet { /* private fields */ }
Expand description
Packet with immutable data.
Implementations§
Source§impl Packet
impl Packet
Sourcepub fn stream_index(&self) -> usize
pub fn stream_index(&self) -> usize
Get stream index.
Sourcepub fn with_stream_index(self, index: usize) -> Packet
pub fn with_stream_index(self, index: usize) -> Packet
Set stream index.
Sourcepub fn with_time_base(self, time_base: TimeBase) -> Self
pub fn with_time_base(self, time_base: TimeBase) -> Self
Set packet time base. (This will rescale the current timestamps into a given time base.)
Sourcepub fn with_raw_pts(self, pts: i64) -> Self
pub fn with_raw_pts(self, pts: i64) -> Self
Set packet presentation timestamp without time base.
Sourcepub fn with_raw_dts(self, dts: i64) -> Self
pub fn with_raw_dts(self, dts: i64) -> Self
Set packet decoding timestamp without time base.
Sourcepub fn duration(&self) -> Option<Duration>
pub fn duration(&self) -> Option<Duration>
Get packet duration.
The method returns None
if the duration is lower or equal to zero.
Sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
Set packet duration.
Sourcepub fn raw_duration(&self) -> i64
pub fn raw_duration(&self) -> i64
Get packet duration in time base units.
Sourcepub fn with_raw_duration(self, duration: i64) -> Self
pub fn with_raw_duration(self, duration: i64) -> Self
Set packet duration in time base units.
Sourcepub fn try_into_mut(self) -> Result<PacketMut, Self>
pub fn try_into_mut(self) -> Result<PacketMut, Self>
Try to make this packet mutable.
The method returns PacketMut
if the packet can be made mutable
without copying the data, otherwise it returns Packet
.
Trait Implementations§
impl Send for Packet
impl Sync for Packet
Auto Trait Implementations§
impl Freeze for Packet
impl RefUnwindSafe for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
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