Struct dome_cloomnik::Channel[][src]

#[repr(transparent)]pub struct Channel<T: Send + Sync = ()>(_, _);

A DOME audio channel.

A channel provides various methods to handle it. Note that the main work in channels happen in their callbacks, and not in other code, but it's nice anyway. The main thing that you can do with a channel is to stop it (using the Channel::stop() method) but this can only be done when the channel is not shared.

Channels are thread-safe.

When a channel drops, it is automagically stopped. If this is not desired, use mem::forget() to not drop it.

Implementations

impl<T: Send + Sync> Channel<T>[src]

pub fn state(&self) -> ChannelState[src]

Queries the state of this channel.

pub fn set_state(&mut self, state: ChannelState)[src]

Sets the state for this channel.

pub fn stop(self)[src]

Stops the channel. This is not a magic: it just takes ownership of the channel (see Channel).

pub fn data(&self) -> Option<RwLockReadGuard<'_, T>>[src]

Gets the user data associated with this channel, for read only. Channels are using RwLock to hold user data, so you can have multiple read-only references but only one read-write reference at a time.

pub fn data_mut(&self) -> Option<RwLockWriteGuard<'_, T>>[src]

Gets the user data associated with this channel, for read and write. Channels are using RwLock to hold user data, so you can have multiple read-only references but only one read-write reference at a time.

Trait Implementations

impl<T: Debug + Send + Sync> Debug for Channel<T>[src]

impl<T: Send + Sync> Drop for Channel<T>[src]

impl Send for Channel[src]

impl Sync for Channel[src]

Auto Trait Implementations

impl<T = ()> !RefUnwindSafe for Channel<T>[src]

impl<T = ()> !Send for Channel<T>[src]

impl<T = ()> !Sync for Channel<T>[src]

impl<T> Unpin for Channel<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Channel<T> where
    T: UnwindSafe
[src]

Blanket Implementations

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

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

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

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.