pub struct SubtreePath<'b, B> { /* private fields */ }
Expand description
Path to a GroveDB’s subtree with no owned data and cheap to clone.
Implementations§
Source§impl SubtreePath<'static, [u8; 0]>
impl SubtreePath<'static, [u8; 0]>
Source§impl<B> SubtreePath<'_, B>
impl<B> SubtreePath<'_, B>
Source§impl<'b, B: AsRef<[u8]>> SubtreePath<'b, B>
impl<'b, B: AsRef<[u8]>> SubtreePath<'b, B>
Sourcepub fn derive_owned(&self) -> SubtreePathBuilder<'b, B>
pub fn derive_owned(&self) -> SubtreePathBuilder<'b, B>
Get a derived path that will reuse this Self as it’s base path and capable of owning data.
Sourcepub fn derive_owned_with_child<'s, S>(
&self,
segment: S,
) -> SubtreePathBuilder<'b, B>where
S: Into<CowLike<'s>>,
's: 'b,
pub fn derive_owned_with_child<'s, S>(
&self,
segment: S,
) -> SubtreePathBuilder<'b, B>where
S: Into<CowLike<'s>>,
's: 'b,
Get a derived path with a child path segment added.
Sourcepub fn derive_parent(&self) -> Option<(SubtreePath<'b, B>, &'b [u8])>
pub fn derive_parent(&self) -> Option<(SubtreePath<'b, B>, &'b [u8])>
Get a derived subtree path for a parent with care for base path slice
case. The main difference from SubtreePath::derive_parent is that
lifetime of returned Self if not limited to the scope where this
function was called so it’s possible to follow to ancestor paths
without keeping previous result as it still will link to 'b
(latest SubtreePath or initial slice of data).
Sourcepub fn into_reverse_iter(self) -> SubtreePathIter<'b, B> ⓘ
pub fn into_reverse_iter(self) -> SubtreePathIter<'b, B> ⓘ
Get a reverse path segments iterator.
Trait Implementations§
Source§impl<B> Clone for SubtreePath<'_, B>
For the same reason as for Hash
implementation, derived impl requires
generics to carry trait bounds that actually don’t needed.
impl<B> Clone for SubtreePath<'_, B>
For the same reason as for Hash
implementation, derived impl requires
generics to carry trait bounds that actually don’t needed.
Source§impl<'b, B: Debug> Debug for SubtreePath<'b, B>
impl<'b, B: Debug> Debug for SubtreePath<'b, B>
Source§impl<'b, B> From<&'b [B]> for SubtreePath<'b, B>
impl<'b, B> From<&'b [B]> for SubtreePath<'b, B>
Source§impl<'s, 'b, B> From<&'s SubtreePath<'b, B>> for SubtreePathBuilder<'b, B>
impl<'s, 'b, B> From<&'s SubtreePath<'b, B>> for SubtreePathBuilder<'b, B>
Source§fn from(value: &'s SubtreePath<'b, B>) -> Self
fn from(value: &'s SubtreePath<'b, B>) -> Self
Source§impl<'s, 'b, B> From<&'s SubtreePathBuilder<'b, B>> for SubtreePath<'s, B>
Create a link to existing SubtreePath that cannot outlive it, because it
possibly owns some of the path segments.
impl<'s, 'b, B> From<&'s SubtreePathBuilder<'b, B>> for SubtreePath<'s, B>
Create a link to existing SubtreePath that cannot outlive it, because it possibly owns some of the path segments.
Source§fn from(value: &'s SubtreePathBuilder<'b, B>) -> Self
fn from(value: &'s SubtreePathBuilder<'b, B>) -> Self
Source§impl<B: AsRef<[u8]>> Hash for SubtreePath<'_, B>
Hash order is the same as iteration order: from most deep path segment up to
root.
impl<B: AsRef<[u8]>> Hash for SubtreePath<'_, B>
Hash order is the same as iteration order: from most deep path segment up to root.
Source§impl<BL> Ord for SubtreePath<'_, BL>
impl<BL> Ord for SubtreePath<'_, BL>
Source§impl<'br, BL, BR> PartialEq<SubtreePath<'br, BR>> for SubtreePath<'_, BL>
impl<'br, BL, BR> PartialEq<SubtreePath<'br, BR>> for SubtreePath<'_, BL>
Source§impl<'br, BL, BR> PartialEq<SubtreePath<'br, BR>> for SubtreePathBuilder<'_, BL>
impl<'br, BL, BR> PartialEq<SubtreePath<'br, BR>> for SubtreePathBuilder<'_, BL>
Source§impl<'br, BL, BR> PartialEq<SubtreePathBuilder<'br, BR>> for SubtreePath<'_, BL>
impl<'br, BL, BR> PartialEq<SubtreePathBuilder<'br, BR>> for SubtreePath<'_, BL>
Source§impl<'br, BL, BR> PartialOrd<SubtreePath<'br, BR>> for SubtreePath<'_, BL>
First and foremost, the order of subtree paths is dictated by their lengths.
Therefore, those subtrees closer to the root will come first. The rest it
can guarantee is to be free of false equality; however, seemingly unrelated
subtrees can come one after another if they share the same length, which was
(not) done for performance reasons.
impl<'br, BL, BR> PartialOrd<SubtreePath<'br, BR>> for SubtreePath<'_, BL>
First and foremost, the order of subtree paths is dictated by their lengths. Therefore, those subtrees closer to the root will come first. The rest it can guarantee is to be free of false equality; however, seemingly unrelated subtrees can come one after another if they share the same length, which was (not) done for performance reasons.