pub struct Card { /* private fields */ }Available on crate feature
alsa only.Expand description
A reference to a card.
Implementations§
Source§impl Card
impl Card
Sourcepub fn open(name: &CStr) -> Result<Self>
pub fn open(name: &CStr) -> Result<Self>
Open the given pcm device identified by name.
§Examples
use audio_device::alsa;
use std::ffi::CStr;
let name = CStr::from_bytes_with_nul(b"hw:0\0")?;
let pcm = alsa::Card::open(name)?;Sourcepub fn index(&self) -> c_int
pub fn index(&self) -> c_int
Get the index of the card.
§Examples
use audio_device::alsa;
for card in alsa::cards() {
let card = card?;
println!("{}", card.index());
}Auto Trait Implementations§
impl Freeze for Card
impl RefUnwindSafe for Card
impl Send for Card
impl Sync for Card
impl Unpin for Card
impl UnsafeUnpin for Card
impl UnwindSafe for Card
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more