Set

Struct Set 

Source
pub struct Set<'db, 'tbl, S, C>
where S: Format, C: Savepointable,
{ /* private fields */ }
Expand description

Deterministic store set.

Implementations§

Source§

impl<S, C> Set<'static, 'static, S, C>
where S: Format, C: Savepointable,

Source

pub fn open(connection: C) -> Result<Self, OpenError>

Source

pub fn unchecked_open(connection: C) -> Self

Open a set without creating it or checking if it exists. This is safe if you call a safe open in (or under) the same transaction or savepoint beforehand.

Source§

impl<'db, 'tbl, S, C> Set<'db, 'tbl, S, C>
where S: Format, C: Savepointable,

Source

pub fn open_with_config( connection: C, config: Config<'db, 'tbl>, ) -> Result<Self, OpenError>

Source

pub fn unchecked_open_with_config( connection: C, config: Config<'db, 'tbl>, ) -> Self

Open a set without creating it or checking if it exists. This is safe if you call a safe open in (or under) the same transaction or savepoint beforehand.

Source

pub fn insert(&mut self, value: &S::In) -> Result<bool, Error<S>>

Source

pub fn contains(&mut self, value: &S::In) -> Result<bool, Error<S>>

Source

pub fn remove(&mut self, value: &S::In) -> Result<bool, Error<S>>

Source

pub fn clear(&mut self) -> Result<(), Error<S>>

Source

pub fn first(&mut self) -> Result<Option<S::Out>, Error<S>>

Source

pub fn last(&mut self) -> Result<Option<S::Out>, Error<S>>

Source

pub fn len(&mut self) -> Result<u64, Error<S>>

Source

pub fn is_empty(&mut self) -> Result<bool, Error<S>>

Source

pub fn iter(&mut self) -> Result<Iter<'db, 'tbl, S, Savepoint<'_>>, Error<S>>

Source

pub fn retain<F>(&mut self, f: F) -> Result<(), Error<S>>
where F: FnMut(S::Out) -> bool,

Retains only the elements specified by the predicate.

In other words, remove all elements e for which f(e) returns false. The elements are visited in ascending serialized order.

This is all done in a single transaction.

Auto Trait Implementations§

§

impl<'db, 'tbl, S, C> Freeze for Set<'db, 'tbl, S, C>
where C: Freeze,

§

impl<'db, 'tbl, S, C> RefUnwindSafe for Set<'db, 'tbl, S, C>

§

impl<'db, 'tbl, S, C> Send for Set<'db, 'tbl, S, C>
where C: Send, S: Send,

§

impl<'db, 'tbl, S, C> Sync for Set<'db, 'tbl, S, C>
where C: Sync, S: Sync,

§

impl<'db, 'tbl, S, C> Unpin for Set<'db, 'tbl, S, C>
where C: Unpin, S: Unpin,

§

impl<'db, 'tbl, S, C> UnwindSafe for Set<'db, 'tbl, S, C>
where C: UnwindSafe, S: UnwindSafe,

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.