Skip to main content

SeekTarget

Struct SeekTarget 

Source
pub struct SeekTarget {
    pub position: f64,
    pub stream_index: Option<usize>,
    pub flags: SeekFlags,
}
Expand description

Target for a seek operation.

Specifies where to seek and which stream to use as reference.

Fields§

§position: f64

Target timestamp in seconds, or byte offset if SeekFlags::BYTE is set.

§stream_index: Option<usize>

Stream index to use for seeking, or None for the default stream.

The default stream is typically the first video stream, or the first audio stream if there are no video streams.

§flags: SeekFlags

Seek flags controlling behavior.

Implementations§

Source§

impl SeekTarget

Source

pub const fn time(position: f64) -> Self

Creates a new seek target to a timestamp in seconds.

§Arguments
  • position - Target timestamp in seconds
Source

pub fn byte(offset: u64) -> Self

Creates a new seek target to a byte offset.

§Arguments
  • offset - Target byte offset in the file
Source

pub const fn sample_accurate(position: f64) -> Self

Creates a sample-accurate seek target.

This will seek to the exact position, decoding from the preceding keyframe and discarding intermediate frames.

Source

pub const fn with_stream(self, stream_index: usize) -> Self

Sets the stream index for this seek target.

Source

pub const fn with_flags(self, flags: SeekFlags) -> Self

Sets the seek flags for this seek target.

Source

pub const fn add_flags(self, flags: SeekFlags) -> Self

Adds additional flags to this seek target.

Source

pub const fn is_backward(&self) -> bool

Returns true if this is a backward seek.

Source

pub const fn is_any(&self) -> bool

Returns true if this allows seeking to any frame.

Source

pub const fn is_keyframe(&self) -> bool

Returns true if this seeks to a keyframe.

Source

pub const fn is_byte(&self) -> bool

Returns true if this is a byte-based seek.

Source

pub const fn is_frame_accurate(&self) -> bool

Returns true if this is a frame-accurate seek.

Trait Implementations§

Source§

impl Clone for SeekTarget

Source§

fn clone(&self) -> SeekTarget

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SeekTarget

Source§

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

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

impl PartialEq for SeekTarget

Source§

fn eq(&self, other: &SeekTarget) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SeekTarget

Source§

impl StructuralPartialEq for SeekTarget

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.