Struct dittolive_ditto::store::query_builder::DittoMutableRegister
source · pub struct DittoMutableRegister<'doc> { /* private fields */ }Expand description
Use doc.get_mut::<DittoMutableRegister>("...") to obtain a mutable
CRDT register.
A mutable CRDT register can be updated while updating a document using
.pending_cursor_op.update(...) or .pending_id_op.update(...).
Implementations§
source§impl 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§
source§impl<'doc> MutableValue<'doc> for DittoMutableRegister<'doc>
impl<'doc> MutableValue<'doc> for DittoMutableRegister<'doc>
type BaseType = DittoRegister
fn mutable_version( base: Self::BaseType, document: &'doc mut Document, path: Box, ) -> Result<Self>
Auto Trait Implementations§
impl<'doc> Freeze for DittoMutableRegister<'doc>
impl<'doc> RefUnwindSafe for DittoMutableRegister<'doc>
impl<'doc> Send for DittoMutableRegister<'doc>
impl<'doc> Sync for DittoMutableRegister<'doc>
impl<'doc> Unpin for DittoMutableRegister<'doc>
impl<'doc> !UnwindSafe for DittoMutableRegister<'doc>
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