Skip to main content

SetMut

Struct SetMut 

Source
pub struct SetMut<'a> { /* private fields */ }
Expand description

Mutable reference to a Set CRDT.

Obtained through Transaction::get_set_mut() or Transaction::set_by_id().

Implementations§

Source§

impl<'a> SetMut<'a>

Source

pub fn id(&self) -> CrdtId

Get the CRDT ID for this set.

Source

pub fn add(&mut self, value: impl Into<PrimitiveValue>)

Add a primitive value to the set.

Accepts any type that implements Into<PrimitiveValue>: bool, i64, i32, String, &str, or () for nil.

Source

pub fn add_str(&mut self, s: &str)

Add a string to the set.

Source

pub fn add_int(&mut self, n: i64)

Add an integer to the set.

Source

pub fn add_bool(&mut self, b: bool)

Add a boolean to the set.

Source

pub fn remove(&mut self, value: impl Into<PrimitiveValue>)

Remove a primitive value from the set.

With OR-Set semantics, this removes all observed instances of the value.

Accepts any type that implements Into<PrimitiveValue>.

Source

pub fn remove_str(&mut self, s: &str)

Remove a string from the set.

Source

pub fn remove_int(&mut self, n: i64)

Remove an integer from the set.

Auto Trait Implementations§

§

impl<'a> Freeze for SetMut<'a>

§

impl<'a> RefUnwindSafe for SetMut<'a>

§

impl<'a> Send for SetMut<'a>

§

impl<'a> Sync for SetMut<'a>

§

impl<'a> Unpin for SetMut<'a>

§

impl<'a> UnsafeUnpin for SetMut<'a>

§

impl<'a> !UnwindSafe for SetMut<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V