pub enum Reducer {
Error,
Replace,
Append,
MergeObject,
Sum,
Max,
Min,
Custom(fn(&Value, &Value) -> Result<Value, String>),
}Expand description
Reducer 枚举 — 描述“这个 key 允许怎么合并“。
Variants§
Error
冲突即报错
Replace
最后写入者胜
Append
数组追加
MergeObject
对象浅合并
Sum
数值求和
Max
取最大值
Min
取最小值
Custom(fn(&Value, &Value) -> Result<Value, String>)
自定义合并函数
Trait Implementations§
impl Copy for Reducer
impl Eq for Reducer
impl StructuralPartialEq for Reducer
Auto Trait Implementations§
impl Freeze for Reducer
impl RefUnwindSafe for Reducer
impl Send for Reducer
impl Sync for Reducer
impl Unpin for Reducer
impl UnsafeUnpin for Reducer
impl UnwindSafe for Reducer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.