Enum txn_types::TsSet [−][src]
A hybrid immutable set for timestamps.
Variants
When the set is empty, avoid the useless cloning of Arc.
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
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][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
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][+]
U: From<T>,
impl<T> Pointable for T
[src][+]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,