pub enum Entry<'a, N, NI, EI, NM>where
NI: Copy + Eq + Debug + 'static,
EI: Copy + Eq + Debug + 'static,
NM: MapWithEntry<Node<N, EI>, Key = NI>,{
Occupied(OccupiedEntry<'a, N, NI, EI, NM>),
Vacant(VacantEntry<'a, N, NI, EI, NM>),
}Expand description
A graph node entry.
Variants§
Occupied(OccupiedEntry<'a, N, NI, EI, NM>)
An occupied graph node.
Vacant(VacantEntry<'a, N, NI, EI, NM>)
A vacant graph node.
Implementations§
Source§impl<'a, N, NI, EI, NM> Entry<'a, N, NI, EI, NM>
impl<'a, N, NI, EI, NM> Entry<'a, N, NI, EI, NM>
Sourcepub fn or_insert(self, default: N) -> &'a mut N
pub fn or_insert(self, default: N) -> &'a mut N
Ensures a value is in the entry by inserting the default if empty, and returns a mutable reference to the value in the entry.
Sourcepub fn or_insert_with<F: FnOnce() -> N>(self, f: F) -> &'a mut N
pub fn or_insert_with<F: FnOnce() -> N>(self, f: F) -> &'a mut N
Ensures a value is in the entry by inserting the result of the default function if empty, and returns a mutable reference to the value in the entry.
Trait Implementations§
Auto Trait Implementations§
impl<'a, N, NI, EI, NM> Freeze for Entry<'a, N, NI, EI, NM>where
<NM as MapWithEntry<Node<N, EI>>>::OccupiedEntry<'a>: Freeze,
<NM as MapWithEntry<Node<N, EI>>>::VacantEntry<'a>: Freeze,
impl<'a, N, NI, EI, NM> RefUnwindSafe for Entry<'a, N, NI, EI, NM>where
<NM as MapWithEntry<Node<N, EI>>>::OccupiedEntry<'a>: RefUnwindSafe,
<NM as MapWithEntry<Node<N, EI>>>::VacantEntry<'a>: RefUnwindSafe,
impl<'a, N, NI, EI, NM> Send for Entry<'a, N, NI, EI, NM>where
<NM as MapWithEntry<Node<N, EI>>>::OccupiedEntry<'a>: Send,
<NM as MapWithEntry<Node<N, EI>>>::VacantEntry<'a>: Send,
impl<'a, N, NI, EI, NM> Sync for Entry<'a, N, NI, EI, NM>where
<NM as MapWithEntry<Node<N, EI>>>::OccupiedEntry<'a>: Sync,
<NM as MapWithEntry<Node<N, EI>>>::VacantEntry<'a>: Sync,
impl<'a, N, NI, EI, NM> Unpin for Entry<'a, N, NI, EI, NM>where
<NM as MapWithEntry<Node<N, EI>>>::OccupiedEntry<'a>: Unpin,
<NM as MapWithEntry<Node<N, EI>>>::VacantEntry<'a>: Unpin,
impl<'a, N, NI, EI, NM> UnwindSafe for Entry<'a, N, NI, EI, NM>where
<NM as MapWithEntry<Node<N, EI>>>::OccupiedEntry<'a>: UnwindSafe,
<NM as MapWithEntry<Node<N, EI>>>::VacantEntry<'a>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more