BTreeSet

Struct BTreeSet 

Source
pub struct BTreeSet<T, A: Allocator = PoolAlloc> { /* private fields */ }
Expand description

用户可以定制内部节点的分配策略.

Implementations§

Source§

impl<T> BTreeSet<T>

Source

pub fn new(degree: u16) -> Self

Source§

impl<T: Ord, A: Allocator> BTreeSet<T, A>

Source

pub fn new_in(degree: u16, alloc: A) -> Self

Source

pub fn iter(&self) -> impl DoubleEndedIterator<Item = &T>

Source

pub fn empty(&self) -> bool

Source

pub fn get<Q>(&self, key: &Q) -> Option<&T>
where T: Borrow<Q>, Q: Ord + ?Sized,

Source

pub fn range<Q, R>(&self, range: R) -> impl DoubleEndedIterator<Item = &T>
where Q: Ord + ?Sized, T: Borrow<Q>, R: RangeBounds<Q>,

Source

pub fn insert(&mut self, val: T) -> Result<(), Error>

Source

pub fn remove<Q>(&mut self, key: &Q) -> Option<T>
where T: Borrow<Q>, Q: Ord,

Trait Implementations§

Source§

impl<T: Send, A: Allocator + Send> Send for BTreeSet<T, A>

Source§

impl<T: Sync, A: Allocator + Sync> Sync for BTreeSet<T, A>

Auto Trait Implementations§

§

impl<T, A> Freeze for BTreeSet<T, A>
where A: Freeze,

§

impl<T, A> RefUnwindSafe for BTreeSet<T, A>

§

impl<T, A> Unpin for BTreeSet<T, A>
where A: Unpin,

§

impl<T, A> UnwindSafe for BTreeSet<T, A>

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>,

Source§

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>,

Source§

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.