Skip to main content

StableBTreeSet

Struct StableBTreeSet 

Source
pub struct StableBTreeSet<K: Storable + Ord + Clone, M: Memory = DefaultMemoryImpl> { /* private fields */ }
Expand description

Governed upstream BTreeSet; initialization and failures follow upstream contracts.

Implementations§

Source§

impl<K: Storable + Ord + Clone, M: Memory> StableBTreeSet<K, M>

Source

pub fn new(memory: RuntimeMemory<M>) -> Self

Delegates to upstream BTreeSet::new with the governed allocation.

Source

pub fn init(memory: RuntimeMemory<M>) -> Self

Delegates to upstream BTreeSet::init with the governed allocation.

Source

pub fn load(memory: RuntimeMemory<M>) -> Self

Delegates to upstream BTreeSet::load with the governed allocation.

Source

pub fn insert(&mut self, key: K) -> bool

Delegates to upstream BTreeSet::insert with the governed allocation.

Source

pub fn contains(&self, key: &K) -> bool

Delegates to upstream BTreeSet::contains with the governed allocation.

Source

pub fn is_empty(&self) -> bool

Delegates to upstream BTreeSet::is_empty with the governed allocation.

Source

pub fn len(&self) -> u64

Delegates to upstream BTreeSet::len with the governed allocation.

Source

pub fn remove(&mut self, key: &K) -> bool

Delegates to upstream BTreeSet::remove with the governed allocation.

Source

pub fn first(&self) -> Option<K>

Delegates to upstream BTreeSet::first with the governed allocation.

Source

pub fn last(&self) -> Option<K>

Delegates to upstream BTreeSet::last with the governed allocation.

Source

pub fn pop_first(&mut self) -> Option<K>

Delegates to upstream BTreeSet::pop_first with the governed allocation.

Source

pub fn pop_last(&mut self) -> Option<K>

Delegates to upstream BTreeSet::pop_last with the governed allocation.

Source

pub fn iter(&self) -> SetIter<'_, K, M>

Delegates to upstream BTreeSet::iter with the governed allocation.

Source

pub fn range(&self, key_range: impl RangeBounds<K>) -> SetIter<'_, K, M>

Delegates to upstream BTreeSet::range with the governed allocation.

Source

pub fn clear(&mut self)

Delegates to upstream BTreeSet::clear with the governed allocation.

Trait Implementations§

Source§

impl<'a, K: Storable + Ord + Clone, M: Memory> IntoIterator for &'a StableBTreeSet<K, M>

Source§

type Item = K

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, K, RuntimeMemory<M>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<K, M = Rc<RefCell<Vec<u8>>>> !Freeze for StableBTreeSet<K, M>

§

impl<K, M = Rc<RefCell<Vec<u8>>>> !RefUnwindSafe for StableBTreeSet<K, M>

§

impl<K, M = Rc<RefCell<Vec<u8>>>> !Send for StableBTreeSet<K, M>

§

impl<K, M = Rc<RefCell<Vec<u8>>>> !Sync for StableBTreeSet<K, M>

§

impl<K, M = Rc<RefCell<Vec<u8>>>> !UnwindSafe for StableBTreeSet<K, M>

§

impl<K, M> Unpin for StableBTreeSet<K, M>

§

impl<K, M> UnsafeUnpin for StableBTreeSet<K, M>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.