pub struct CustomChannel<T> { /* private fields */ }Expand description
Custom channel: hold a value of type T plus user-supplied write,
read, and reset closures. Implements Channel (with a custom
kind label) and is therefore registry-compatible alongside the
stock channels.
Use this when none of the built-in channels match your semantics but you don’t want a whole new struct + trait impl.
Implementations§
Source§impl<T: Default> CustomChannel<T>
impl<T: Default> CustomChannel<T>
Source§impl<T> CustomChannel<T>
impl<T> CustomChannel<T>
Sourcepub fn with_initial<F>(label: &'static str, initial: T, on_write: F) -> Self
pub fn with_initial<F>(label: &'static str, initial: T, on_write: F) -> Self
Build with explicit initial value.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for CustomChannel<T>where
T: Freeze,
impl<T> !RefUnwindSafe for CustomChannel<T>
impl<T> Send for CustomChannel<T>where
T: Send,
impl<T> Sync for CustomChannel<T>where
T: Sync,
impl<T> Unpin for CustomChannel<T>where
T: Unpin,
impl<T> UnsafeUnpin for CustomChannel<T>where
T: UnsafeUnpin,
impl<T> !UnwindSafe for CustomChannel<T>
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