Struct VacantEntry
pub struct VacantEntry<'a, T, A: Allocator + Clone = Global> { pub(in ::collections::btree::set) inner: VacantEntry<'a, T, SetValZST, A> }
A view into a vacant entry in a BTreeSet.
It is part of the Entry enum.
Examples
use ;
let mut set = new;
let entry_v = match set.entry ;
entry_v.insert;
assert!;
// Nonexistent key (insert)
match set.entry
assert!;
Fields
inner: VacantEntry<'a, T, SetValZST, A>
Implementations
impl<'a, T: Ord, A: Allocator + Clone> VacantEntry<'a, T, A>
fn get(&self) -> &TGets a reference to the value that would be used when inserting through the
VacantEntry.Examples
use BTreeSet; let mut set = new; assert_eq!;fn into_value(self) -> TTake ownership of the value.
Examples
use ; let mut set = new; match set.entryfn insert(self)Sets the value of the entry with the VacantEntry's value.
Examples
use BTreeSet; use Entry; let mut set = new; if let Vacant = set.entry assert!;fn insert_entry(self) -> OccupiedEntry<'a, T, A>
Trait Implementations
impl<T: Debug + Ord, A: Allocator + Clone> Debug for VacantEntry<'_, T, A>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<'a, T, A = Global> !UnwindSafe for VacantEntry<'a, T, A>
impl<'a, T, A> Freeze for VacantEntry<'a, T, A>
where
VacantEntry<'a, T, SetValZST, A>: Freeze,
impl<'a, T, A> RefUnwindSafe for VacantEntry<'a, T, A>
where
VacantEntry<'a, T, SetValZST, A>: RefUnwindSafe,
impl<'a, T, A> Send for VacantEntry<'a, T, A>
where
VacantEntry<'a, T, SetValZST, A>: Send,
impl<'a, T, A> Sync for VacantEntry<'a, T, A>
where
VacantEntry<'a, T, SetValZST, A>: Sync,
impl<'a, T, A> Unpin for VacantEntry<'a, T, A>
where
VacantEntry<'a, T, SetValZST, A>: Unpin,
impl<'a, T, A> UnsafeUnpin for VacantEntry<'a, T, A>
where
VacantEntry<'a, T, SetValZST, A>: UnsafeUnpin,
Blanket Implementations
impl<T> Any for VacantEntry<'a, T, A>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for VacantEntry<'a, T, A>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for VacantEntry<'a, T, A>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for VacantEntry<'a, T, A>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for VacantEntry<'a, T, A>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for VacantEntry<'a, T, A>
impl<T, U> Into<U> for VacantEntry<'a, T, A>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for VacantEntry<'a, T, A>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for VacantEntry<'a, T, A>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>