Struct dittolive_ditto::prelude::DittoRegister
source · [−]pub struct DittoRegister {
pub value: Value,
}
Expand description
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: Value
Implementations
sourceimpl 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
sourceimpl Clone for DittoRegister
impl Clone for DittoRegister
sourcefn clone(&self) -> DittoRegister
fn clone(&self) -> DittoRegister
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DittoRegister
impl Debug for DittoRegister
sourceimpl<'de> Deserialize<'de> for DittoRegister
impl<'de> Deserialize<'de> for DittoRegister
sourcefn 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
sourceimpl From<Value> for DittoRegister
impl From<Value> for DittoRegister
sourcefn from(value: Value) -> DittoRegister
fn from(value: Value) -> DittoRegister
Performs the conversion.
sourceimpl PartialEq<DittoRegister> for DittoRegister
impl PartialEq<DittoRegister> for DittoRegister
sourcefn eq(&self, other: &DittoRegister) -> bool
fn eq(&self, other: &DittoRegister) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &DittoRegister) -> bool
fn ne(&self, other: &DittoRegister) -> bool
This method tests for !=
.
sourceimpl Serialize for DittoRegister
impl Serialize for DittoRegister
impl StructuralPartialEq for DittoRegister
Auto Trait Implementations
impl RefUnwindSafe for DittoRegister
impl Send for DittoRegister
impl Sync for DittoRegister
impl Unpin for DittoRegister
impl UnwindSafe for DittoRegister
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ManuallyDropMut for T
impl<T> ManuallyDropMut for T
type Ret = ManuallyDrop<T>
pub fn manually_drop_mut(&'__ mut self) -> &'__ mut ManuallyDrop<T>
impl<T> To for T where
T: ?Sized,
impl<T> To for T where
T: ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more