pub struct ChannelLayout { /* private fields */ }
Expand description
Some common layout definitions
Implementations§
Source§impl ChannelLayout
impl ChannelLayout
pub const FRONT_LEFT: ChannelLayout
pub const FRONT_RIGHT: ChannelLayout
pub const FRONT_CENTER: ChannelLayout
pub const LOW_FREQUENCY: ChannelLayout
pub const BACK_LEFT: ChannelLayout
pub const BACK_RIGHT: ChannelLayout
pub const FRONT_LEFT_OF_CENTER: ChannelLayout
pub const FRONT_RIGHT_OF_CENTER: ChannelLayout
pub const BACK_CENTER: ChannelLayout
pub const SIDE_LEFT: ChannelLayout
pub const SIDE_RIGHT: ChannelLayout
pub const TOP_CENTER: ChannelLayout
pub const TOP_FRONT_LEFT: ChannelLayout
pub const TOP_FRONT_CENTER: ChannelLayout
pub const TOP_FRONT_RIGHT: ChannelLayout
pub const TOP_BACK_LEFT: ChannelLayout
pub const TOP_BACK_CENTER: ChannelLayout
pub const TOP_BACK_RIGHT: ChannelLayout
Sourcepub const fn empty() -> ChannelLayout
pub const fn empty() -> ChannelLayout
Returns an empty set of flags.
Sourcepub const fn all() -> ChannelLayout
pub const fn all() -> ChannelLayout
Returns the set containing all flags.
Sourcepub const fn from_bits(bits: u32) -> Option<ChannelLayout>
pub const fn from_bits(bits: u32) -> Option<ChannelLayout>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u32) -> ChannelLayout
pub const fn from_bits_truncate(bits: u32) -> ChannelLayout
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> ChannelLayout
pub const unsafe fn from_bits_unchecked(bits: u32) -> ChannelLayout
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
§Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
Sourcepub const fn intersects(&self, other: ChannelLayout) -> bool
pub const fn intersects(&self, other: ChannelLayout) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: ChannelLayout) -> bool
pub const fn contains(&self, other: ChannelLayout) -> bool
Returns true
if all of the flags in other
are contained within self
.
Sourcepub fn insert(&mut self, other: ChannelLayout)
pub fn insert(&mut self, other: ChannelLayout)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: ChannelLayout)
pub fn remove(&mut self, other: ChannelLayout)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: ChannelLayout)
pub fn toggle(&mut self, other: ChannelLayout)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: ChannelLayout, value: bool)
pub fn set(&mut self, other: ChannelLayout, value: bool)
Inserts or removes the specified flags depending on the passed value.
Sourcepub const fn intersection(self, other: ChannelLayout) -> ChannelLayout
pub const fn intersection(self, other: ChannelLayout) -> ChannelLayout
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
Sourcepub const fn union(self, other: ChannelLayout) -> ChannelLayout
pub const fn union(self, other: ChannelLayout) -> ChannelLayout
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
Sourcepub const fn difference(self, other: ChannelLayout) -> ChannelLayout
pub const fn difference(self, other: ChannelLayout) -> ChannelLayout
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
Sourcepub const fn symmetric_difference(self, other: ChannelLayout) -> ChannelLayout
pub const fn symmetric_difference(self, other: ChannelLayout) -> ChannelLayout
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
Sourcepub const fn complement(self) -> ChannelLayout
pub const fn complement(self) -> ChannelLayout
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Source§impl ChannelLayout
impl ChannelLayout
pub const UNDEFINED: ChannelLayout
pub const MONO: ChannelLayout
pub const MONO_LFE: ChannelLayout
pub const STEREO: ChannelLayout
pub const STEREO_LFE: ChannelLayout
pub const _3F: ChannelLayout
pub const _3F_LFE: ChannelLayout
pub const _2F1: ChannelLayout
pub const _2F1_LFE: ChannelLayout
pub const _3F1: ChannelLayout
pub const _3F1_LFE: ChannelLayout
pub const _2F2: ChannelLayout
pub const _2F2_LFE: ChannelLayout
pub const QUAD: ChannelLayout
pub const QUAD_LFE: ChannelLayout
pub const _3F2: ChannelLayout
pub const _3F2_LFE: ChannelLayout
pub const _3F2_BACK: ChannelLayout
pub const _3F2_LFE_BACK: ChannelLayout
pub const _3F3R_LFE: ChannelLayout
pub const _3F4_LFE: ChannelLayout
Source§impl ChannelLayout
impl ChannelLayout
pub fn num_channels(&self) -> u32
Trait Implementations§
Source§impl Binary for ChannelLayout
impl Binary for ChannelLayout
Source§impl BitAnd for ChannelLayout
impl BitAnd for ChannelLayout
Source§fn bitand(self, other: ChannelLayout) -> ChannelLayout
fn bitand(self, other: ChannelLayout) -> ChannelLayout
Returns the intersection between the two sets of flags.
Source§type Output = ChannelLayout
type Output = ChannelLayout
&
operator.Source§impl BitAndAssign for ChannelLayout
impl BitAndAssign for ChannelLayout
Source§fn bitand_assign(&mut self, other: ChannelLayout)
fn bitand_assign(&mut self, other: ChannelLayout)
Disables all flags disabled in the set.
Source§impl BitOr for ChannelLayout
impl BitOr for ChannelLayout
Source§fn bitor(self, other: ChannelLayout) -> ChannelLayout
fn bitor(self, other: ChannelLayout) -> ChannelLayout
Returns the union of the two sets of flags.
Source§type Output = ChannelLayout
type Output = ChannelLayout
|
operator.Source§impl BitOrAssign for ChannelLayout
impl BitOrAssign for ChannelLayout
Source§fn bitor_assign(&mut self, other: ChannelLayout)
fn bitor_assign(&mut self, other: ChannelLayout)
Adds the set of flags.
Source§impl BitXor for ChannelLayout
impl BitXor for ChannelLayout
Source§fn bitxor(self, other: ChannelLayout) -> ChannelLayout
fn bitxor(self, other: ChannelLayout) -> ChannelLayout
Returns the left flags, but with all the right flags toggled.
Source§type Output = ChannelLayout
type Output = ChannelLayout
^
operator.Source§impl BitXorAssign for ChannelLayout
impl BitXorAssign for ChannelLayout
Source§fn bitxor_assign(&mut self, other: ChannelLayout)
fn bitxor_assign(&mut self, other: ChannelLayout)
Toggles the set of flags.
Source§impl Clone for ChannelLayout
impl Clone for ChannelLayout
Source§fn clone(&self) -> ChannelLayout
fn clone(&self) -> ChannelLayout
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ChannelLayout
impl Debug for ChannelLayout
Source§impl Extend<ChannelLayout> for ChannelLayout
impl Extend<ChannelLayout> for ChannelLayout
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ChannelLayout>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ChannelLayout>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl From<u32> for ChannelLayout
impl From<u32> for ChannelLayout
Source§fn from(x: u32) -> ChannelLayout
fn from(x: u32) -> ChannelLayout
Source§impl FromIterator<ChannelLayout> for ChannelLayout
impl FromIterator<ChannelLayout> for ChannelLayout
Source§fn from_iter<T>(iterator: T) -> ChannelLayoutwhere
T: IntoIterator<Item = ChannelLayout>,
fn from_iter<T>(iterator: T) -> ChannelLayoutwhere
T: IntoIterator<Item = ChannelLayout>,
Source§impl Hash for ChannelLayout
impl Hash for ChannelLayout
Source§impl LowerHex for ChannelLayout
impl LowerHex for ChannelLayout
Source§impl Not for ChannelLayout
impl Not for ChannelLayout
Source§fn not(self) -> ChannelLayout
fn not(self) -> ChannelLayout
Returns the complement of this set of flags.
Source§type Output = ChannelLayout
type Output = ChannelLayout
!
operator.Source§impl Octal for ChannelLayout
impl Octal for ChannelLayout
Source§impl Ord for ChannelLayout
impl Ord for ChannelLayout
Source§fn cmp(&self, other: &ChannelLayout) -> Ordering
fn cmp(&self, other: &ChannelLayout) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ChannelLayout
impl PartialEq for ChannelLayout
Source§impl PartialOrd for ChannelLayout
impl PartialOrd for ChannelLayout
Source§impl Sub for ChannelLayout
impl Sub for ChannelLayout
Source§fn sub(self, other: ChannelLayout) -> ChannelLayout
fn sub(self, other: ChannelLayout) -> ChannelLayout
Returns the set difference of the two sets of flags.
Source§type Output = ChannelLayout
type Output = ChannelLayout
-
operator.Source§impl SubAssign for ChannelLayout
impl SubAssign for ChannelLayout
Source§fn sub_assign(&mut self, other: ChannelLayout)
fn sub_assign(&mut self, other: ChannelLayout)
Disables all flags enabled in the set.