Struct libpulse_simple_binding::Simple
source · pub struct Simple { /* private fields */ }
Expand description
An opaque simple connection object.
Implementations
sourceimpl 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>
Create 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>
Wait 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>
Read 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) -> Option<MicroSeconds>
pub fn get_latency(&self) -> Option<MicroSeconds>
Return the playback or record latency.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Simple
impl !Send for Simple
impl !Sync for Simple
impl Unpin for Simple
impl UnwindSafe for Simple
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more