pub struct DittoRegister {
pub value: Value,
}Expand description
Use doc.get::<DittoRegister>("...") to obtain a read-only CRDT register.
Represents a CRDT register that can be upserted as part of a document or assigned to a property during an update of a document.
Fields§
§value: ValueImplementations§
Source§impl DittoRegister
impl DittoRegister
Sourcepub fn new<T: Serialize>(value: T) -> Result<Self, DittoError>
pub fn new<T: Serialize>(value: T) -> Result<Self, DittoError>
Create a new register with the provided value
Sourcepub fn value<T: DeserializeOwned>(&self) -> Result<T, DittoError>
pub fn value<T: DeserializeOwned>(&self) -> Result<T, DittoError>
Access to the value within the register.
The operation may fail if the content of the register can not be serialized into T.
Trait Implementations§
Source§impl Clone for DittoRegister
impl Clone for DittoRegister
Source§fn clone(&self) -> DittoRegister
fn clone(&self) -> DittoRegister
Returns a copy 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 DittoRegister
impl Debug for DittoRegister
Source§impl<'de> Deserialize<'de> for DittoRegister
impl<'de> Deserialize<'de> for DittoRegister
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<Value> for DittoRegister
impl From<Value> for DittoRegister
Source§fn from(value: Value) -> DittoRegister
fn from(value: Value) -> DittoRegister
Converts to this type from the input type.
Source§impl PartialEq for DittoRegister
impl PartialEq for DittoRegister
Source§impl Serialize for DittoRegister
impl Serialize for DittoRegister
impl StructuralPartialEq for DittoRegister
Auto Trait Implementations§
impl Freeze for DittoRegister
impl RefUnwindSafe for DittoRegister
impl Send for DittoRegister
impl Sync for DittoRegister
impl Unpin for DittoRegister
impl UnwindSafe for DittoRegister
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