Enum AudioCaptureUsage2
pub enum AudioCaptureUsage2 {
Background,
Foreground,
SystemAgent,
Communication,
// some variants omitted
}
Expand description
Usages annotating the purpose of the stream being used to capture audio. The AudioCaptureUsage is used by audio policy to dictate how audio streams interact with each other.
Variants§
Background
Stream is used to capture audio while in the background. These streams may be active at any the time and are considered privileged. Example: Listening for Hotwords
Foreground
Stream is intended to be used for normal capture functionality. Streams that are used for audio capture while the stream creator is in the foreground should use this. Example: Voice Recorder
SystemAgent
Stream is for interaction with a system agent. This should only be used once a user has signalled their intent to have the interaction with an interested party. Examples: Assistant, Siri, Alexa
Communication
Stream is intended to be used for some form of real time user to user communication. Voice/Video chat should use this.
Implementations§
§impl AudioCaptureUsage2
impl AudioCaptureUsage2
pub fn from_primitive(prim: u32) -> Option<AudioCaptureUsage2>
pub fn from_primitive_allow_unknown(prim: u32) -> AudioCaptureUsage2
pub fn unknown() -> AudioCaptureUsage2
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
§impl Clone for AudioCaptureUsage2
impl Clone for AudioCaptureUsage2
§fn clone(&self) -> AudioCaptureUsage2
fn clone(&self) -> AudioCaptureUsage2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for AudioCaptureUsage2
impl Debug for AudioCaptureUsage2
§impl<D> Decode<AudioCaptureUsage2, D> for AudioCaptureUsage2where
D: ResourceDialect,
impl<D> Decode<AudioCaptureUsage2, D> for AudioCaptureUsage2where
D: ResourceDialect,
§fn new_empty() -> AudioCaptureUsage2
fn new_empty() -> AudioCaptureUsage2
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<AudioCaptureUsage2, D> for AudioCaptureUsage2where
D: ResourceDialect,
impl<D> Encode<AudioCaptureUsage2, D> for AudioCaptureUsage2where
D: ResourceDialect,
§impl Hash for AudioCaptureUsage2
impl Hash for AudioCaptureUsage2
§impl Ord for AudioCaptureUsage2
impl Ord for AudioCaptureUsage2
§fn cmp(&self, other: &AudioCaptureUsage2) -> Ordering
fn cmp(&self, other: &AudioCaptureUsage2) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for AudioCaptureUsage2
impl PartialEq for AudioCaptureUsage2
§impl PartialOrd for AudioCaptureUsage2
impl PartialOrd for AudioCaptureUsage2
§impl TypeMarker for AudioCaptureUsage2
impl TypeMarker for AudioCaptureUsage2
§type Owned = AudioCaptureUsage2
type Owned = AudioCaptureUsage2
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for AudioCaptureUsage2
impl ValueTypeMarker for AudioCaptureUsage2
§type Borrowed<'a> = AudioCaptureUsage2
type Borrowed<'a> = AudioCaptureUsage2
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<AudioCaptureUsage2 as TypeMarker>::Owned,
) -> <AudioCaptureUsage2 as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<AudioCaptureUsage2 as TypeMarker>::Owned, ) -> <AudioCaptureUsage2 as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.