Struct dittolive_ditto::types::DittoMutableRegister
source · [−]pub struct DittoMutableRegister { /* private fields */ }
Expand description
Represents a mutable CRDT register that can be updated while updating a document.
This class can’t be instantiated directly. It’s returned from the
get_mut
method of DittoMutDocument.
Implementations
sourceimpl DittoMutableRegister
impl DittoMutableRegister
sourcepub fn set<T: Serialize>(&mut self, value: T) -> Result<(), DittoError>
pub fn set<T: Serialize>(&mut self, value: T) -> Result<(), DittoError>
Set content of the register to a new 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 MutableValue for DittoMutableRegister
impl MutableValue for DittoMutableRegister
type BaseType = DittoRegister
fn mutable_version(
base: Self::BaseType,
document: &mut Document,
path: Box
) -> Result<Self>
Auto Trait Implementations
impl RefUnwindSafe for DittoMutableRegister
impl !Send for DittoMutableRegister
impl !Sync for DittoMutableRegister
impl Unpin for DittoMutableRegister
impl UnwindSafe for DittoMutableRegister
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