[−][src]Struct pagecache::VecSet
A set built on top of Vec
and binary search,
for use when calling nth
to iterate over a set
is too expensive, and the set size is expected to be
~10 or less most of the time.
Methods
impl<T> VecSet<T> where
T: Ord + Eq,
[src]
T: Ord + Eq,
pub fn insert(&mut self, item: T) -> bool
[src]
Insert a new item
pub fn remove(&mut self, item: &T) -> Option<T>
[src]
Removes an item by value
pub fn contains(&self, item: &T) -> bool
[src]
Returns true
if the item is present
pub fn is_empty(&self) -> bool
[src]
Returns true
if the set is empty
pub fn len(&self) -> usize
[src]
Returns the size of the set
pub fn get(&self, idx: usize) -> Option<&T>
[src]
Indexes into the underlying buffer
pub fn clear(&mut self)
[src]
Clears the underlying buffer
Trait Implementations
impl<T: PartialEq> PartialEq<VecSet<T>> for VecSet<T>
[src]
impl<T: Default> Default for VecSet<T>
[src]
impl<T: Clone> Clone for VecSet<T>
[src]
fn clone(&self) -> VecSet<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for VecSet<T>
[src]
impl<T> Serialize for VecSet<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, T> Deserialize<'de> for VecSet<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>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,