Enum txn_types::TsSet[][src]

pub enum TsSet {
    Empty,
    Vec(Arc<[TimeStamp]>),
    Set(Arc<HashSet<TimeStamp>>),
}

A hybrid immutable set for timestamps.

Variants

Empty

When the set is empty, avoid the useless cloning of Arc.

Vec(Arc<[TimeStamp]>)

Vec is suitable when the set is small or the set is barely used, and it doesn’t worth converting a Vec into a HashSet.

Set(Arc<HashSet<TimeStamp>>)

Set is suitable when there are many timestamps and it will be queried multiple times.

Implementations

impl TsSet[src]

pub fn new(ts: Vec<TimeStamp>) -> Self[src]

Create a TsSet from the given vec of timestamps. It will select the proper internal collection type according to the size.

pub fn from_u64s(ts: Vec<u64>) -> Self[src]

pub fn vec_from_u64s(ts: Vec<u64>) -> Self[src]

pub fn vec(ts: Vec<TimeStamp>) -> Self[src]

Create a TsSet from the given vec of timestamps, but it will be forced to use Vec as the internal collection type. When it’s sure that the set will be queried at most once, use this is better than TsSet::new, since both the querying on Vec and the conversion from Vec to HashSet is O(N).

pub fn contains(&self, ts: TimeStamp) -> bool[src]

Query whether the given timestamp is contained in the set.

Trait Implementations

impl Clone for TsSet[src]

impl Debug for TsSet[src]

impl Default for TsSet[src]

impl PartialEq<TsSet> for TsSet[src]

impl StructuralPartialEq for TsSet[src]

Auto Trait Implementations

impl RefUnwindSafe for TsSet

impl Send for TsSet

impl Sync for TsSet

impl Unpin for TsSet

impl UnwindSafe for TsSet

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]