Struct Streams

Source
pub struct Streams<'a> { /* private fields */ }
Expand description

A collection of streams. Streams implements IntoIterator to iterate over the streams.

Implementations§

Source§

impl<'a> Streams<'a>

Source

pub const unsafe fn new(input: *mut AVFormatContext) -> Self

Creates a new Streams instance.

§Safety

This function is unsafe because the caller must ensure that the lifetime & the mutablity of the AVFormatContext matches the lifetime & mutability of the Streams.

Source

pub fn best_index(&self, media_type: AVMediaType) -> Option<usize>

Returns the index of the best stream of the given media type.

Source

pub fn best(&'a self, media_type: AVMediaType) -> Option<Const<'a, Stream<'a>>>

Returns the best stream of the given media type.

Source

pub fn best_mut(&'a mut self, media_type: AVMediaType) -> Option<Stream<'a>>

Returns the best mutable stream of the given media type.

Source

pub const fn iter(&'a self) -> StreamIter<'a>

Returns an iterator over the streams.

Source

pub const fn len(&self) -> usize

Returns the length of the streams.

Source

pub const fn is_empty(&self) -> bool

Returns whether the streams are empty.

Source

pub const fn get(&'a mut self, index: usize) -> Option<Stream<'a>>

Returns the stream at the given index.

Source

pub const unsafe fn get_unchecked(&self, index: usize) -> Option<Stream<'a>>

Returns the stream at the given index.

§Safety

This function is unsafe because it does not require mutability. The caller must guarantee that the stream is not mutated and that multiple streams of the same index exist.

Trait Implementations§

Source§

impl Debug for Streams<'_>

Source§

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

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

impl<'a> IntoIterator for Streams<'a>

Source§

type IntoIter = StreamIter<'a>

Which kind of iterator are we turning this into?
Source§

type Item = Const<'a, Stream<'a>>

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl Send for Streams<'_>

Safety: Streams is safe to send between threads.

Auto Trait Implementations§

§

impl<'a> Freeze for Streams<'a>

§

impl<'a> RefUnwindSafe for Streams<'a>

§

impl<'a> !Sync for Streams<'a>

§

impl<'a> Unpin for Streams<'a>

§

impl<'a> !UnwindSafe for Streams<'a>

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more