Struct linear_collections::VecSet

source ·
pub struct VecSet<T: Eq> { /* private fields */ }

Implementations§

source§

impl<T: Eq> VecSet<T>

source

pub fn new() -> Self

Creates a new, empty VecSet

source

pub fn with_capacity(capacity: usize) -> Self

Creates a VecSet that can hold capacity elements without reallocating

source

pub fn len(&self) -> usize

Returns the number of items in of the set

source

pub fn is_empty(&self) -> bool

Returns true if the store is empty, false otherwise.

source

pub fn insert(&mut self, value: T) -> bool

Adds a value to the set. If the set did not previously contain this value, true is returned. If the set already contained this value, false is returned, and the set is not modified: original value is not replaced, and the value passed as argument is dropped.

source

pub fn remove(&mut self, value: &T) -> Option<T>

Attempts to remove the referenced value from the set, returning None if it is not present.

source

pub fn into_inner(self) -> Vec<T>

Returns the backing vector of this type

Auto Trait Implementations§

§

impl<T> Freeze for VecSet<T>

§

impl<T> RefUnwindSafe for VecSet<T>
where T: RefUnwindSafe,

§

impl<T> Send for VecSet<T>
where T: Send,

§

impl<T> Sync for VecSet<T>
where T: Sync,

§

impl<T> Unpin for VecSet<T>
where T: Unpin,

§

impl<T> UnwindSafe for VecSet<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.