Skip to main content

CodecList

Trait CodecList 

Source
pub trait CodecList: Sized {
    type D: ?Sized;

    // Required methods
    fn new() -> Self;
    fn by_name(&self, name: &str) -> Option<&'static Self::D>;
    fn append(&mut self, desc: &'static Self::D);

    // Provided method
    fn from_list(descs: &[&'static Self::D]) -> Self { ... }
}
Expand description

Defines a series of methods to interact with a list of codec descriptors.

Required Associated Types§

Source

type D: ?Sized

The type of the structure used to describe a codec.

Required Methods§

Source

fn new() -> Self

Creates a new codec list.

Source

fn by_name(&self, name: &str) -> Option<&'static Self::D>

Search by name whether a codec descriptor is in the codec list and returns it.

If the requested codec descriptor is not in the list, None is returned.

Source

fn append(&mut self, desc: &'static Self::D)

Appends a codec to the list.

Provided Methods§

Source

fn from_list(descs: &[&'static Self::D]) -> Self

Creates a new codec list starting from a list of codec descriptors.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Descriptor + ?Sized> CodecList for av_codec::decoder::Codecs<T>

Source§

type D = T

Source§

impl<T: Descriptor + ?Sized> CodecList for av_codec::encoder::Codecs<T>

Source§

type D = T