pub struct Channel {
pub name: String,
pub reducer: Reducer,
pub default: Option<Value>,
}Expand description
Channel definition for a state field
Fields§
§name: StringChannel name
reducer: ReducerReducer for merging updates
default: Option<Value>Default value
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn with_reducer(self, reducer: Reducer) -> Self
pub fn with_reducer(self, reducer: Reducer) -> Self
Set the reducer
Sourcepub fn with_default(self, default: Value) -> Self
pub fn with_default(self, default: Value) -> Self
Set the default value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Channel
impl !RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl !UnwindSafe for Channel
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)