pub enum Entry<'a, P, Tag, K>{
Vacant(VacantEntry<'a, P, Tag, K>),
Occupied(OccupiedEntry<'a, P, Tag>),
}Expand description
Result of a search operation in an AvlTree.
Variants§
Vacant(VacantEntry<'a, P, Tag, K>)
Occupied(OccupiedEntry<'a, P, Tag>)
Implementations§
Source§impl<'a, P, Tag, K> Entry<'a, P, Tag, K>
impl<'a, P, Tag, K> Entry<'a, P, Tag, K>
pub fn unwrap_occupied(self) -> OccupiedEntry<'a, P, Tag>where
K: Debug,
pub fn unwrap_vacant(self) -> VacantEntry<'a, P, Tag, K>
pub fn try_occupied(self) -> Option<OccupiedEntry<'a, P, Tag>>
pub fn try_vacant(self) -> Option<VacantEntry<'a, P, Tag, K>>
Source§impl<'a, P, Tag> Entry<'a, P, Tag, Last>
impl<'a, P, Tag> Entry<'a, P, Tag, Last>
Sourcepub unsafe fn append_unchecked(self, node: P) -> Self
pub unsafe fn append_unchecked(self, node: P) -> Self
Append node to the last entry, return the new entry.
For efficient batch insert without redundant seeking to the last, only rotation will be triggered after insert.
§Safety
You have to make sure the node append in total ordering
Sourcepub fn append<F>(self, node: P, cmp_f: F) -> Result<Self, P>
pub fn append<F>(self, node: P, cmp_f: F) -> Result<Self, P>
Append node to the last entry with check, return the new entry.
For efficient batch insert without redundant seeking to the last, only rotation will be triggered after insert.
§Arguments:
node: the node to insertcmp_f: compareP::Targetof the entry andnode. If it returns Ordering::Less, insertnodeand returnOk; otherwise returnErr(node)
Source§impl<'a, P, Tag> Entry<'a, P, Tag, First>
impl<'a, P, Tag> Entry<'a, P, Tag, First>
Sourcepub unsafe fn prepend_unchecked(self, node: P) -> Self
pub unsafe fn prepend_unchecked(self, node: P) -> Self
Prepend node to the first entry, return the new entry.
For efficient batch insert without redundant seeking to the first, only rotation will be triggered after insert.
§Safety
You have to make sure the node append in total ordering
Sourcepub fn prepend<F>(self, node: P, cmp_f: F) -> Result<Self, P>
pub fn prepend<F>(self, node: P, cmp_f: F) -> Result<Self, P>
Prepend node to the first entry with check, return the new entry.
For efficient batch insert without redundant seeking to the first, only rotation will be triggered after insert.
§Arguments:
node: the node to insertcmp_f: compareP::Targetof thenodeand entry. If it returns Ordering::Less, insertnodeand returnOk; otherwise returnErr(node)