pub struct VecSortedSet<T>(/* private fields */);Expand description
Implementations§
Source§impl<T> VecSortedSet<T>where
T: Ord,
impl<T> VecSortedSet<T>where
T: Ord,
pub fn new() -> Self
pub fn with_capacity(n: usize) -> Self
pub fn capacity(&self) -> usize
pub fn reserve(&mut self, n: usize)
pub fn shrink_to_fit(&mut self)
pub fn clear(&mut self)
Sourcepub fn insert(&mut self, e: T) -> Option<T>
pub fn insert(&mut self, e: T) -> Option<T>
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.
Sourcepub fn remove<Q>(&mut self, e: &Q) -> Option<T>
pub fn remove<Q>(&mut self, e: &Q) -> Option<T>
O(log(len)) when e does not exist. O(len) for removing an element,
because of the need for shifting all elements after it.
pub fn append(&mut self, other: &mut VecSortedSet<T>)
pub fn reserve_exact(&mut self, n: usize)
pub fn pop(&mut self) -> Option<T>
pub fn truncate(&mut self, n: usize)
pub fn retain<F>(&mut self, f: F)
pub fn split_off(&mut self, at: usize) -> VecSortedSet<T>
pub fn is_disjoint(&self, other: &VecSortedSet<T>) -> bool
pub fn is_subset(&self, other: &VecSortedSet<T>) -> bool
pub fn is_superset(&self, other: &VecSortedSet<T>) -> bool
pub fn union<'a>(&'a self, other: &'a VecSortedSet<T>) -> Union<'a, T>
pub fn intersection<'a>( &'a self, other: &'a VecSortedSet<T>, ) -> Intersection<'a, T>
pub fn difference<'a>(&'a self, other: &'a VecSortedSet<T>) -> Difference<'a, T>
pub fn symmetric_difference<'a>( &'a self, other: &'a VecSortedSet<T>, ) -> SymmetricDifference<'a, T>
Source§impl<T> VecSortedSet<T>
impl<T> VecSortedSet<T>
Trait Implementations§
Source§impl<'a, 'b, T> BitAnd<&'b VecSortedSet<T>> for &'a VecSortedSet<T>
impl<'a, 'b, T> BitAnd<&'b VecSortedSet<T>> for &'a VecSortedSet<T>
Source§fn bitand(self, other: &VecSortedSet<T>) -> VecSortedSet<T>
fn bitand(self, other: &VecSortedSet<T>) -> VecSortedSet<T>
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]);Source§type Output = VecSortedSet<T>
type Output = VecSortedSet<T>
The resulting type after applying the
& operator.Source§impl<T> BitAnd for VecSortedSet<T>where
T: Ord,
impl<T> BitAnd for VecSortedSet<T>where
T: Ord,
Source§fn bitand(self, other: VecSortedSet<T>) -> VecSortedSet<T>
fn bitand(self, other: VecSortedSet<T>) -> VecSortedSet<T>
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]);Source§type Output = VecSortedSet<T>
type Output = VecSortedSet<T>
The resulting type after applying the
& operator.Source§impl<'a, 'b, T> BitOr<&'b VecSortedSet<T>> for &'a VecSortedSet<T>
impl<'a, 'b, T> BitOr<&'b VecSortedSet<T>> for &'a VecSortedSet<T>
Source§fn bitor(self, other: &VecSortedSet<T>) -> VecSortedSet<T>
fn bitor(self, other: &VecSortedSet<T>) -> VecSortedSet<T>
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]);Source§type Output = VecSortedSet<T>
type Output = VecSortedSet<T>
The resulting type after applying the
| operator.Source§impl<T> BitOr for VecSortedSet<T>where
T: Ord,
impl<T> BitOr for VecSortedSet<T>where
T: Ord,
Source§fn bitor(self, other: VecSortedSet<T>) -> VecSortedSet<T>
fn bitor(self, other: VecSortedSet<T>) -> VecSortedSet<T>
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]);Source§type Output = VecSortedSet<T>
type Output = VecSortedSet<T>
The resulting type after applying the
| operator.Source§impl<'a, 'b, T> BitXor<&'b VecSortedSet<T>> for &'a VecSortedSet<T>
impl<'a, 'b, T> BitXor<&'b VecSortedSet<T>> for &'a VecSortedSet<T>
Source§fn bitxor(self, other: &VecSortedSet<T>) -> VecSortedSet<T>
fn bitxor(self, other: &VecSortedSet<T>) -> VecSortedSet<T>
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]);Source§type Output = VecSortedSet<T>
type Output = VecSortedSet<T>
The resulting type after applying the
^ operator.Source§impl<T> BitXor for VecSortedSet<T>where
T: Ord,
impl<T> BitXor for VecSortedSet<T>where
T: Ord,
Source§fn bitxor(self, other: VecSortedSet<T>) -> VecSortedSet<T>
fn bitxor(self, other: VecSortedSet<T>) -> VecSortedSet<T>
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]);Source§type Output = VecSortedSet<T>
type Output = VecSortedSet<T>
The resulting type after applying the
^ operator.Source§impl<T: Clone> Clone for VecSortedSet<T>
impl<T: Clone> Clone for VecSortedSet<T>
Source§fn clone(&self) -> VecSortedSet<T>
fn clone(&self) -> VecSortedSet<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for VecSortedSet<T>
impl<T> Debug for VecSortedSet<T>
Source§impl<T: Default> Default for VecSortedSet<T>
impl<T: Default> Default for VecSortedSet<T>
Source§fn default() -> VecSortedSet<T>
fn default() -> VecSortedSet<T>
Returns the “default value” for a type. Read more
Source§impl<'a, T> Extend<&'a T> for VecSortedSet<T>
impl<'a, T> Extend<&'a T> for VecSortedSet<T>
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = &'a T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = &'a T>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T> Extend<T> for VecSortedSet<T>where
T: Ord,
impl<T> Extend<T> for VecSortedSet<T>where
T: Ord,
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T> FromIterator<T> for VecSortedSet<T>where
T: Ord,
impl<T> FromIterator<T> for VecSortedSet<T>where
T: Ord,
Source§fn from_iter<I>(iter: I) -> VecSortedSet<T>where
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> VecSortedSet<T>where
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Source§impl<T: Hash> Hash for VecSortedSet<T>
impl<T: Hash> Hash for VecSortedSet<T>
Source§impl<'a, T, Q> Index<&'a Q> for VecSortedSet<T>
impl<'a, T, Q> Index<&'a Q> for VecSortedSet<T>
Source§impl<'a, T: 'a> IntoIterator for &'a VecSortedSet<T>
impl<'a, T: 'a> IntoIterator for &'a VecSortedSet<T>
Source§impl<T> IntoIterator for VecSortedSet<T>
impl<T> IntoIterator for VecSortedSet<T>
Source§impl<T: Ord> Ord for VecSortedSet<T>
impl<T: Ord> Ord for VecSortedSet<T>
Source§fn cmp(&self, other: &VecSortedSet<T>) -> Ordering
fn cmp(&self, other: &VecSortedSet<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for VecSortedSet<T>
impl<T: PartialEq> PartialEq for VecSortedSet<T>
Source§impl<T: PartialOrd> PartialOrd for VecSortedSet<T>
impl<T: PartialOrd> PartialOrd for VecSortedSet<T>
Source§impl<T> Set<T> for VecSortedSet<T>where
T: Ord,
impl<T> Set<T> for VecSortedSet<T>where
T: Ord,
Source§impl<'a, 'b, T> Sub<&'b VecSortedSet<T>> for &'a VecSortedSet<T>
impl<'a, 'b, T> Sub<&'b VecSortedSet<T>> for &'a VecSortedSet<T>
Source§fn sub(self, other: &VecSortedSet<T>) -> VecSortedSet<T>
fn sub(self, other: &VecSortedSet<T>) -> VecSortedSet<T>
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]);Source§type Output = VecSortedSet<T>
type Output = VecSortedSet<T>
The resulting type after applying the
- operator.Source§impl<T> Sub for VecSortedSet<T>where
T: Ord,
impl<T> Sub for VecSortedSet<T>where
T: Ord,
Source§fn sub(self, other: VecSortedSet<T>) -> VecSortedSet<T>
fn sub(self, other: VecSortedSet<T>) -> VecSortedSet<T>
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]);Source§type Output = VecSortedSet<T>
type Output = VecSortedSet<T>
The resulting type after applying the
- operator.impl<T: Eq> Eq for VecSortedSet<T>
impl<T> StructuralPartialEq for VecSortedSet<T>
Auto Trait Implementations§
impl<T> Freeze for VecSortedSet<T>
impl<T> RefUnwindSafe for VecSortedSet<T>where
T: RefUnwindSafe,
impl<T> Send for VecSortedSet<T>where
T: Send,
impl<T> Sync for VecSortedSet<T>where
T: Sync,
impl<T> Unpin for VecSortedSet<T>where
T: Unpin,
impl<T> UnwindSafe for VecSortedSet<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more