Struct timely::progress::frontier::Antichain [−][src]
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]
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]
T: Ord,
Sorts the elements so that comparisons between antichains can be made.
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]);
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]
Vec<T>: Abomonation,
T: Abomonation,
unsafe fn entomb<W: Write>(&self, _write: &mut W) -> Result<()>
[src]
fn extent(&self) -> usize
[src]
unsafe fn exhume<'a, 'b>(
&'a mut self,
bytes: &'b mut [u8]
) -> Option<&'b mut [u8]>
[src]
&'a mut self,
bytes: &'b mut [u8]
) -> Option<&'b mut [u8]>
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]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
T: Serialize,
Auto Trait Implementations
impl<T> RefUnwindSafe for Antichain<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Antichain<T> where
T: Send,
T: Send,
impl<T> Sync for Antichain<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Antichain<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Antichain<T> where
T: UnwindSafe,
T: UnwindSafe,
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Data for T where
T: 'static + Clone,
[src]
T: 'static + Clone,
impl<T> Data for T where
T: 'static + Send + Sync + Any + Abomonation,
[src]
T: 'static + Send + Sync + Any + Abomonation,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> ExchangeData for T where
T: Data + Data,
[src]
T: Data + Data,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ProgressEventTimestamp for T where
T: Data + Any + Debug,
[src]
T: Data + Any + Debug,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,