pub struct AudioCapsBuilder<T> { /* private fields */ }

Implementations§

source§

impl AudioCapsBuilder<NoFeature>

source

pub fn new() -> Self

Constructs an AudioCapsBuilder for the “audio/x-raw” encoding.

If left unchanged, the resulting Caps will be initialized with:

  • “audio/x-raw” encoding.
  • maximum rate range.
  • maximum channels range.
  • both interleaved and non-interleaved layouts.
  • all available formats.

Use AudioCapsBuilder::for_encoding to specify another encoding.

source

pub fn new_interleaved() -> Self

Constructs an AudioCapsBuilder for the “audio/x-raw” encoding with interleaved layout.

If left unchanged, the resulting Caps will be initialized with:

  • “audio/x-raw” encoding.
  • maximum rate range.
  • maximum channels range.
  • interleaved layout.
  • all available formats.

Use AudioCapsBuilder::for_encoding to specify another encoding.

source

pub fn for_encoding(encoding: impl IntoGStr) -> Self

Constructs an AudioCapsBuilder for the specified encoding.

The resulting Caps will use the encoding argument as name and will not contain any additional fields unless explicitly added.

source

pub fn any_features(self) -> AudioCapsBuilder<HasFeatures>

source

pub fn features( self, features: impl IntoIterator<Item = impl IntoGStr> ) -> AudioCapsBuilder<HasFeatures>

source§

impl<T> AudioCapsBuilder<T>

source

pub fn format(self, format: AudioFormat) -> Self

source

pub fn format_list(self, formats: impl IntoIterator<Item = AudioFormat>) -> Self

source

pub fn rate(self, rate: i32) -> Self

source

pub fn rate_range(self, rates: impl RangeBounds<i32>) -> Self

source

pub fn rate_list(self, rates: impl IntoIterator<Item = i32>) -> Self

source

pub fn channels(self, channels: i32) -> Self

source

pub fn channels_range(self, channels: impl RangeBounds<i32>) -> Self

source

pub fn channels_list(self, channels: impl IntoIterator<Item = i32>) -> Self

source

pub fn layout(self, layout: AudioLayout) -> Self

source

pub fn layout_list(self, layouts: impl IntoIterator<Item = AudioLayout>) -> Self

source

pub fn channel_mask(self, channel_mask: u64) -> Self

source

pub fn fallback_channel_mask(self) -> Self

source

pub fn field(self, name: &str, value: impl Into<Value> + Send) -> Self

source

pub fn build(self) -> Caps

Trait Implementations§

source§

impl Default for AudioCapsBuilder<NoFeature>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for AudioCapsBuilder<T>
where T: RefUnwindSafe,

§

impl<T> Send for AudioCapsBuilder<T>
where T: Send,

§

impl<T> Sync for AudioCapsBuilder<T>
where T: Sync,

§

impl<T> Unpin for AudioCapsBuilder<T>
where T: Unpin,

§

impl<T> UnwindSafe for AudioCapsBuilder<T>
where T: UnwindSafe,

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.

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>,

§

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>,

§

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.