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

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.

Methods

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 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 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]

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

Important traits for &'_ mut [u8]
pub fn elements(&self) -> &[T][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]);

Trait Implementations

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

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

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

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

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

impl<T> StructuralPartialEq for Antichain<T>[src]

impl<T> StructuralEq for Antichain<T>[src]

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

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

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

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> Data for T where
    T: 'static + Clone
[src]

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

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

impl<T> From<T> for T[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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

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