Struct protocoll::set::VecSortedSet [] [src]

pub struct VecSortedSet<T>(_);

an array-set. very efficient for small sets.

for explanations about the methods, see BTreeSet and Vec.

Methods

impl<T> VecSortedSet<T> where
    T: Ord
[src]

O(log(len))

O(log(len))

O(log(len))

O(log(len)) when e already exists. O(len) for inserting a new element, caused by shifting all elements after it, which can be avoided by always inserting in order.

O(log(len)) when e does not exist. O(len) for removing an element, because of the need for shifting all elements after it.

impl<T> VecSortedSet<T>
[src]

a view for the underlying vec. &self methods for Vec such as get and split can be accessed through this.

iterate over the underlying vec.

Trait Implementations

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

Returns the "default value" for a type. Read more

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

impl<T: PartialOrd> PartialOrd for VecSortedSet<T>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Ord> Ord for VecSortedSet<T>
[src]

This method returns an Ordering between self and other. Read more

impl<T: Hash> Hash for VecSortedSet<T>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T> IntoIterator for VecSortedSet<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<'a, T: 'a> IntoIterator for &'a VecSortedSet<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<T> Extend<T> for VecSortedSet<T> where
    T: Ord
[src]

Extends a collection with the contents of an iterator. Read more

impl<'a, T> Extend<&'a T> for VecSortedSet<T> where
    T: Ord + Copy
[src]

Extends a collection with the contents of an iterator. Read more

impl<T> FromIterator<T> for VecSortedSet<T> where
    T: Ord
[src]

Creates a value from an iterator. Read more

impl<'a, T, Q: ?Sized> Index<&'a Q> for VecSortedSet<T> where
    T: Ord,
    T: Borrow<Q>,
    Q: Ord
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<T> Debug for VecSortedSet<T> where
    T: Ord + Debug
[src]

Formats the value using the given formatter.

impl<T> Set<T> for VecSortedSet<T> where
    T: Ord
[src]

a set maps from items to themselves.

adds item i. Read more

removes item i. Read more

clear.

shrink_to_fit.

pours another collection into this one. Read more

impl<T> BitOr<VecSortedSet<T>> for VecSortedSet<T> where
    T: Ord
[src]

The resulting type after applying the | operator

union.

example

use protocoll::set::VecSortedSet;
let s1:VecSortedSet<_> = vec![1,2,3].into_iter().collect();
let s2:VecSortedSet<_> = vec![2,3,4].into_iter().collect();
assert_eq!((s1 | s2).view_content(), &[1,2,3,4]);

impl<'a, 'b, T> BitOr<&'b VecSortedSet<T>> for &'a VecSortedSet<T> where
    T: Ord + Clone
[src]

The resulting type after applying the | operator

union with cloned members.

example

use protocoll::set::VecSortedSet;
let s1:VecSortedSet<_> = vec![1,2,3].into_iter().collect();
let s2:VecSortedSet<_> = vec![2,3,4].into_iter().collect();
assert_eq!((&s1 | &s2).view_content(), &[1,2,3,4]);

impl<T> BitAnd<VecSortedSet<T>> for VecSortedSet<T> where
    T: Ord
[src]

The resulting type after applying the & operator

intersection.

example

use protocoll::set::VecSortedSet;
let s1:VecSortedSet<_> = vec![1,2,3].into_iter().collect();
let s2:VecSortedSet<_> = vec![2,3,4].into_iter().collect();
assert_eq!((s1 & s2).view_content(), &[2,3]);

impl<'a, 'b, T> BitAnd<&'b VecSortedSet<T>> for &'a VecSortedSet<T> where
    T: Ord + Clone
[src]

The resulting type after applying the & operator

intersection with cloned members.

example

use protocoll::set::VecSortedSet;
let s1:VecSortedSet<_> = vec![1,2,3].into_iter().collect();
let s2:VecSortedSet<_> = vec![2,3,4].into_iter().collect();
assert_eq!((&s1 & &s2).view_content(), &[2,3]);

impl<T> Sub<VecSortedSet<T>> for VecSortedSet<T> where
    T: Ord
[src]

The resulting type after applying the - operator

difference.

example

use protocoll::set::VecSortedSet;
let s1:VecSortedSet<_> = vec![1,2,3].into_iter().collect();
let s2:VecSortedSet<_> = vec![2,3,4].into_iter().collect();
assert_eq!((s1 - s2).view_content(), &[1]);

impl<'a, 'b, T> Sub<&'b VecSortedSet<T>> for &'a VecSortedSet<T> where
    T: Ord + Clone
[src]

The resulting type after applying the - operator

difference with cloned members.

example

use protocoll::set::VecSortedSet;
let s1:VecSortedSet<_> = vec![1,2,3].into_iter().collect();
let s2:VecSortedSet<_> = vec![2,3,4].into_iter().collect();
assert_eq!((&s1 - &s2).view_content(), &[1]);

impl<T> BitXor<VecSortedSet<T>> for VecSortedSet<T> where
    T: Ord
[src]

The resulting type after applying the ^ operator

symmetric difference.

example

use protocoll::set::VecSortedSet;
let s1:VecSortedSet<_> = vec![1,2,3].into_iter().collect();
let s2:VecSortedSet<_> = vec![2,3,4].into_iter().collect();
assert_eq!((s1 ^ s2).view_content(), &[1,4]);

impl<'a, 'b, T> BitXor<&'b VecSortedSet<T>> for &'a VecSortedSet<T> where
    T: Ord + Clone
[src]

The resulting type after applying the ^ operator

symmetric difference with cloned members.

example

use protocoll::set::VecSortedSet;
let s1:VecSortedSet<_> = vec![1,2,3].into_iter().collect();
let s2:VecSortedSet<_> = vec![2,3,4].into_iter().collect();
assert_eq!((&s1 ^ &s2).view_content(), &[1,4]);