pub enum PrimitiveValue {
Nil,
Bool(bool),
Int(i64),
Float(NotNan<f64>),
Str(String),
}Expand description
Primitive value type for write operations.
This is the input type for MapMut::set(), SetMut::add(), and
SetMut::remove(). Unlike Value, it cannot contain CRDT references,
so the type system prevents passing a Map/Text/Set/Register handle
where a primitive is expected.
Use the create_map(), create_text(), etc. methods to create
nested CRDTs instead.
Variants§
Nil
Nil/null value.
Bool(bool)
Boolean value.
Int(i64)
64-bit signed integer.
Float(NotNan<f64>)
64-bit floating point (never NaN).
Str(String)
String value (UTF-8).
Trait Implementations§
Source§impl Clone for PrimitiveValue
impl Clone for PrimitiveValue
Source§fn clone(&self) -> PrimitiveValue
fn clone(&self) -> PrimitiveValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrimitiveValue
impl Debug for PrimitiveValue
Source§impl<'de> Deserialize<'de> for PrimitiveValue
impl<'de> Deserialize<'de> for PrimitiveValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&str> for PrimitiveValue
impl From<&str> for PrimitiveValue
Source§impl From<()> for PrimitiveValue
impl From<()> for PrimitiveValue
Source§impl From<PrimitiveValue> for Value
impl From<PrimitiveValue> for Value
Source§fn from(v: PrimitiveValue) -> Self
fn from(v: PrimitiveValue) -> Self
Converts to this type from the input type.
Source§impl From<String> for PrimitiveValue
impl From<String> for PrimitiveValue
Source§impl From<bool> for PrimitiveValue
impl From<bool> for PrimitiveValue
Source§impl From<f64> for PrimitiveValue
Panics if the value is NaN.
impl From<f64> for PrimitiveValue
Panics if the value is NaN.
Source§impl From<i32> for PrimitiveValue
impl From<i32> for PrimitiveValue
Source§impl From<i64> for PrimitiveValue
impl From<i64> for PrimitiveValue
Source§impl PartialEq for PrimitiveValue
impl PartialEq for PrimitiveValue
Source§impl Serialize for PrimitiveValue
impl Serialize for PrimitiveValue
impl Eq for PrimitiveValue
impl StructuralPartialEq for PrimitiveValue
Auto Trait Implementations§
impl Freeze for PrimitiveValue
impl RefUnwindSafe for PrimitiveValue
impl Send for PrimitiveValue
impl Sync for PrimitiveValue
impl Unpin for PrimitiveValue
impl UnsafeUnpin for PrimitiveValue
impl UnwindSafe for PrimitiveValue
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