Struct dome_cloomnik::Channel [−][src]
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]
T: Unpin,
impl<T> UnwindSafe for Channel<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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.
pub 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>,