pub struct CustomCrdt {
pub config: CrdtBuilderConfig,
pub fields: HashMap<String, GenericCrdtField>,
pub replica_id: ReplicaId,
}Expand description
Custom CRDT built using the builder framework
Fields§
§config: CrdtBuilderConfigCRDT configuration
fields: HashMap<String, GenericCrdtField>Field values
replica_id: ReplicaIdReplica ID
Implementations§
Source§impl CustomCrdt
impl CustomCrdt
Sourcepub fn new(config: CrdtBuilderConfig, replica_id: ReplicaId) -> Self
pub fn new(config: CrdtBuilderConfig, replica_id: ReplicaId) -> Self
Create a new custom CRDT
Sourcepub fn set_field(
&mut self,
field_name: &str,
value: Value,
) -> Result<(), BuilderError>
pub fn set_field( &mut self, field_name: &str, value: Value, ) -> Result<(), BuilderError>
Set a field value
Sourcepub fn field_names(&self) -> Vec<String>
pub fn field_names(&self) -> Vec<String>
Get all field names
Sourcepub fn get_field_config(&self, field_name: &str) -> Option<&FieldConfig>
pub fn get_field_config(&self, field_name: &str) -> Option<&FieldConfig>
Get field configuration
Trait Implementations§
Source§impl CRDT for CustomCrdt
impl CRDT for CustomCrdt
fn replica_id(&self) -> &ReplicaId
Source§impl Clone for CustomCrdt
impl Clone for CustomCrdt
Source§fn clone(&self) -> CustomCrdt
fn clone(&self) -> CustomCrdt
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomCrdt
impl Debug for CustomCrdt
Source§impl<'de> Deserialize<'de> for CustomCrdt
impl<'de> Deserialize<'de> for CustomCrdt
Source§fn 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
Source§impl Mergeable for CustomCrdt
impl Mergeable for CustomCrdt
Source§impl PartialEq for CustomCrdt
impl PartialEq for CustomCrdt
Source§impl Serialize for CustomCrdt
impl Serialize for CustomCrdt
impl StructuralPartialEq for CustomCrdt
Auto Trait Implementations§
impl Freeze for CustomCrdt
impl RefUnwindSafe for CustomCrdt
impl Send for CustomCrdt
impl Sync for CustomCrdt
impl Unpin for CustomCrdt
impl UnwindSafe for CustomCrdt
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