[−][src]Struct libpulse_simple_binding::Simple
An opaque simple connection object.
Methods
impl Simple
[src]
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>
[src]
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.
pub fn write(&self, data: &[u8]) -> Result<(), PAErr>
[src]
Writes some data to the server.
pub fn drain(&self) -> Result<(), PAErr>
[src]
Waits until all data already written is played by the daemon.
pub fn read(&self, data: &mut [u8]) -> Result<(), PAErr>
[src]
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.
pub fn get_latency(&self) -> Option<MicroSeconds>
[src]
Gets the playback or record latency.
pub fn flush(&self) -> Result<(), PAErr>
[src]
Flushes the playback or record buffer.
This discards any audio in the buffer.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,