pub struct StateKey<T> { /* private fields */ }Expand description
编译期类型安全的 State 键。
Implementations§
Source§impl<T> StateKey<T>
impl<T> StateKey<T>
pub const fn new(name: &'static str, reducer: Reducer) -> Self
pub const fn append(name: &'static str) -> Self
pub const fn sum(name: &'static str) -> Self
pub const fn replace(name: &'static str) -> Self
pub const fn merge_object(name: &'static str) -> Self
pub const fn max(name: &'static str) -> Self
pub const fn min(name: &'static str) -> Self
pub const fn error(name: &'static str) -> Self
pub fn name(&self) -> &str
pub fn reducer(&self) -> &Reducer
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for StateKey<T>
impl<T> RefUnwindSafe for StateKey<T>where
T: RefUnwindSafe,
impl<T> Send for StateKey<T>where
T: Send,
impl<T> Sync for StateKey<T>where
T: Sync,
impl<T> Unpin for StateKey<T>where
T: Unpin,
impl<T> UnsafeUnpin for StateKey<T>
impl<T> UnwindSafe for StateKey<T>where
T: UnwindSafe,
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