Struct timely::progress::frontier::Antichain[][src]

pub struct Antichain<T> { /* fields omitted */ }

A set of mutually incomparable elements.

An antichain is a set of partially ordered elements, each of which is incomparable to the others. This antichain implementation allows you to repeatedly introduce elements to the antichain, and which will evict larger elements to maintain the minimal antichain, those incomparable elements no greater than any other element.

Two antichains are equal if the contain the same set of elements, even if in different orders. This can make equality testing quadratic, though linear in the common case that the sequences are identical.

Implementations

impl<T: PartialOrder> Antichain<T>[src]

pub fn insert(&mut self, element: T) -> bool[src]

Updates the Antichain if the element is not greater than or equal to some present element.

Returns true if element is added to the set

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::new();
 assert!(frontier.insert(2));
 assert!(!frontier.insert(3));

pub fn extend<I: IntoIterator<Item = T>>(&mut self, iterator: I) -> bool[src]

Performs a sequence of insertion and return true iff any insertion does.

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::new();
 assert!(frontier.extend(Some(3)));
 assert!(frontier.extend(vec![2, 5]));
 assert!(!frontier.extend(vec![3, 4]));

pub fn less_than(&self, time: &T) -> bool[src]

Returns true if any item in the antichain is strictly less than the argument.

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::from_elem(2);
 assert!(frontier.less_than(&3));
 assert!(!frontier.less_than(&2));
 assert!(!frontier.less_than(&1));

 frontier.clear();
 assert!(!frontier.less_than(&3));

pub fn less_equal(&self, time: &T) -> bool[src]

Returns true if any item in the antichain is less than or equal to the argument.

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::from_elem(2);
 assert!(frontier.less_equal(&3));
 assert!(frontier.less_equal(&2));
 assert!(!frontier.less_equal(&1));

 frontier.clear();
 assert!(!frontier.less_equal(&3));

pub fn dominates(&self, other: &Antichain<T>) -> bool[src]

👎 Deprecated since 0.12.0:

please use PartialOrder::less_equal instead

Returns true if every element of other is greater or equal to some element of self.

impl<T> Antichain<T>[src]

pub fn new() -> Antichain<T>[src]

Creates a new empty Antichain.

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::<u32>::new();

pub fn from_elem(element: T) -> Antichain<T>[src]

Creates a new singleton Antichain.

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::from_elem(2);

pub fn clear(&mut self)[src]

Clears the contents of the antichain.

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::from_elem(2);
 frontier.clear();
 assert!(frontier.elements().is_empty());

pub fn sort(&mut self) where
    T: Ord
[src]

Sorts the elements so that comparisons between antichains can be made.

pub fn elements(&self) -> &[T]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Reveals the elements in the antichain.

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::from_elem(2);
 assert_eq!(frontier.elements(), &[2]);

pub fn borrow(&self) -> AntichainRef<'_, T>[src]

Reveals the elements in the antichain.

Examples

 use timely::progress::frontier::Antichain;

 let mut frontier = Antichain::from_elem(2);
 assert_eq!(&*frontier.borrow(), &[2]);

Trait Implementations

impl<T> Abomonation for Antichain<T> where
    Vec<T>: Abomonation,
    T: Abomonation
[src]

impl<T: Clone> Clone for Antichain<T>[src]

impl<T: Debug> Debug for Antichain<T>[src]

impl<T: Default> Default for Antichain<T>[src]

impl<'de, T> Deserialize<'de> for Antichain<T> where
    T: Deserialize<'de>, 
[src]

impl<T: Eq> Eq for Antichain<T>[src]

impl<T: PartialOrder> From<Vec<T, Global>> for Antichain<T>[src]

impl<T: PartialEq> PartialEq<Antichain<T>> for Antichain<T>[src]

impl<T: PartialOrder> PartialOrder for Antichain<T>[src]

impl<T> Serialize for Antichain<T> where
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Antichain<T> where
    T: RefUnwindSafe

impl<T> Send for Antichain<T> where
    T: Send

impl<T> Sync for Antichain<T> where
    T: Sync

impl<T> Unpin for Antichain<T> where
    T: Unpin

impl<T> UnwindSafe for Antichain<T> where
    T: UnwindSafe

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> Data for T where
    T: 'static + Clone
[src]

impl<T> Data for T where
    T: 'static + Send + Sync + Any + Abomonation
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> ExchangeData for T where
    T: Data + Data
[src]

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

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

impl<T> ProgressEventTimestamp for T where
    T: Data + Any + Debug
[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.