pub struct ClientHandle { /* private fields */ }Expand description
A live connection.
The connection reconnects on its own after a drop, so the handle and the event stream outlive
an individual session. Dropping the handle or the event stream ends it; ClientHandle::finished
waits without ending it.
Implementations§
Source§impl ClientHandle
impl ClientHandle
Sourcepub fn control(&self) -> ControlHandle
pub fn control(&self) -> ControlHandle
Returns a handle for the playback controls of this connection.
The handle is a cheap clone; every copy controls the same connection.
Sourcepub async fn finished(self) -> Result<()>
pub async fn finished(self) -> Result<()>
Waits for the connection to end and returns its outcome.
The connection ends when the handle or the event stream is dropped, or when the audio sink fails; a dropped session is reconnected, not returned. Awaiting this keeps the handle alive, so dropping the event stream is the usual way to stop.
Trait Implementations§
Source§impl Debug for ClientHandle
impl Debug for ClientHandle
Source§impl Drop for ClientHandle
impl Drop for ClientHandle
Auto Trait Implementations§
impl !RefUnwindSafe for ClientHandle
impl !UnwindSafe for ClientHandle
impl Forget for ClientHandle
impl Freeze for ClientHandle
impl Move for ClientHandle
impl Send for ClientHandle
impl Sync for ClientHandle
impl Unpin for ClientHandle
impl UnsafeUnpin for ClientHandle
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