Struct libpulse_simple_binding::Simple
source · pub struct Simple { /* private fields */ }
Expand description
An opaque simple connection object.
Implementations§
source§impl Simple
impl Simple
sourcepub fn new(
server: Option<&str>,
name: &str,
dir: Direction,
dev: Option<&str>,
stream_name: &str,
ss: &Spec,
map: Option<&Map>,
attr: Option<&BufferAttr>
) -> Result<Self, PAErr>
pub fn new( server: Option<&str>, name: &str, dir: Direction, dev: Option<&str>, stream_name: &str, ss: &Spec, map: Option<&Map>, attr: Option<&BufferAttr> ) -> Result<Self, PAErr>
Creates a new connection to the server.
Params
server
: Server name, orNone
for default.name
: A descriptive name for this client (application name, …).dir
: Open this stream for recording or playback?dev
: Sink (resp. source) name, orNone
for default.stream_name
: A descriptive name for this stream (application name, song title, …).ss
: The sample type to use.map
: The channel map to use, orNone
for default.attr
: Buffering attributes, orNone
for default.
sourcepub fn drain(&self) -> Result<(), PAErr>
pub fn drain(&self) -> Result<(), PAErr>
Waits until all data already written is played by the daemon.
sourcepub fn read(&self, data: &mut [u8]) -> Result<(), PAErr>
pub fn read(&self, data: &mut [u8]) -> Result<(), PAErr>
Reads some data from the server.
This function blocks until data.len()
amount of data has been received from the server,
or until an error occurs.
sourcepub fn get_latency(&self) -> Result<MicroSeconds, PAErr>
pub fn get_latency(&self) -> Result<MicroSeconds, PAErr>
Gets the playback or record latency.
Trait Implementations§
Auto Trait Implementations§
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