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, orNonefor default.name: A descriptive name for this client (application name, …).dir: Open this stream for recording or playback?dev: Sink (resp. source) name, orNonefor 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, orNonefor default.attr: Buffering attributes, orNonefor 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§
impl Freeze for Simple
impl RefUnwindSafe for Simple
impl Unpin for Simple
impl UnsafeUnpin for Simple
impl UnwindSafe for Simple
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