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 moresourceimpl 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
Converts to this type from the input type.
sourceimpl PartialEq<DittoRegister> for DittoRegister
impl PartialEq<DittoRegister> for DittoRegister
sourcefn eq(&self, other: &DittoRegister) -> bool
fn eq(&self, other: &DittoRegister) -> bool
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CompatExt for T
impl<T> CompatExt for T
fn compat_ref(&self) -> Compat<&T>
fn compat_ref(&self) -> Compat<&T>
Applies the [
Compat
] adapter by shared reference. Read morefn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Applies the [
Compat
] adapter by mutable reference. Read more