[][src]Struct libpulse_simple_binding::Simple

pub struct Simple { /* fields omitted */ }

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]

Creates a new connection to the server.

Params

  • server: Server name, or None for default.
  • name: A descriptive name for this client (application name, ...).
  • dir: Open this stream for recording or playback?
  • dev: Sink (resp. source) name, or None 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, or None for default.
  • attr: Buffering attributes, or None 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

impl Sync for Simple[src]

impl Drop for Simple[src]

impl Send for Simple[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]