Struct dittolive_ditto::types::DittoMutableRga
source · [−]pub struct DittoMutableRga { /* private fields */ }
Expand description
Represents a mutable CRDT rga 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 DittoMutableRga
impl DittoMutableRga
sourcepub fn get<T: DeserializeOwned>(&self, index: usize) -> Result<T, DittoError>
👎 Deprecated: DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
pub fn get<T: DeserializeOwned>(&self, index: usize) -> Result<T, DittoError>
DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
The operation may fail if the content of the Rga can not be serialized into T
sourcepub fn set<T: Serialize>(
&mut self,
value: T,
index: usize
) -> Result<(), DittoError>
👎 Deprecated: DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
pub fn set<T: Serialize>(
&mut self,
value: T,
index: usize
) -> Result<(), DittoError>
DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
Set a value at the specified index.
sourcepub fn remove(&mut self, index: usize) -> Result<(), DittoError>
👎 Deprecated: DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
pub fn remove(&mut self, index: usize) -> Result<(), DittoError>
DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
Remove a value at the specified index.
sourcepub fn push<T: Serialize + Clone>(&mut self, value: T) -> Result<(), DittoError>
👎 Deprecated: DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
pub fn push<T: Serialize + Clone>(&mut self, value: T) -> Result<(), DittoError>
DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
Push a value on to the end of the RGA.
sourcepub fn pop(&mut self) -> Result<Value, DittoError>
👎 Deprecated: DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
pub fn pop(&mut self) -> Result<Value, DittoError>
DittoRga usage should be replaced. Use arrays inside DittoRegisters instead
Pop a value off the end of the RGA.
Trait Implementations
sourceimpl MutableValue for DittoMutableRga
impl MutableValue for DittoMutableRga
Auto Trait Implementations
impl RefUnwindSafe for DittoMutableRga
impl !Send for DittoMutableRga
impl !Sync for DittoMutableRga
impl Unpin for DittoMutableRga
impl UnwindSafe for DittoMutableRga
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