Struct SubtreePathBuilder

Source
pub struct SubtreePathBuilder<'b, B> { /* private fields */ }
Expand description

Path to a GroveDB’s subtree.

Implementations§

Source§

impl SubtreePathBuilder<'static, [u8; 0]>

Source

pub fn new() -> Self

Creates empty subtree path

Source§

impl<B> SubtreePathBuilder<'_, B>

Source

pub fn len(&self) -> usize

Returns the length of the subtree path.

Source

pub fn is_empty(&self) -> bool

Returns whether the path is empty (the root tree).

Source§

impl<'b, B: AsRef<[u8]>> SubtreePathBuilder<'b, B>

Source

pub fn derive_owned(&'b self) -> SubtreePathBuilder<'b, B>

Get a derived path that will use another subtree path (or reuse the base slice) as it’s base, then could be edited in place.

Source

pub fn derive_parent(&self) -> Option<(SubtreePath<'_, B>, &[u8])>

Get a derived path for a parent and a chopped segment. Returned SubtreePath will be linked to this SubtreePath because it might contain owned data and it has to outlive SubtreePath.

Source

pub fn derive_owned_with_child<'s, S>( &'b self, segment: S, ) -> SubtreePathBuilder<'b, B>
where S: Into<CowLike<'s>>, 's: 'b,

Get a derived path with a child path segment added.

Source

pub fn push_segment(&mut self, segment: &[u8])

Adds path segment in place.

Source

pub fn reverse_iter(&'b self) -> SubtreePathIter<'b, B>

Returns an iterator for the subtree path by path segments.

Source

pub fn to_vec(&self) -> Vec<Vec<u8>>

Collect path as a vector of vectors, but this actually negates all the benefits of this library.

Source

pub fn is_root(&self) -> bool

Retuns true if the subtree path is empty, so it points to the root tree.

Trait Implementations§

Source§

impl<'b, B: Debug> Debug for SubtreePathBuilder<'b, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SubtreePathBuilder<'static, [u8; 0]>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'s, 'b, B> From<&'s SubtreePath<'b, B>> for SubtreePathBuilder<'b, B>

Source§

fn from(value: &'s SubtreePath<'b, B>) -> Self

Converts to this type from the input type.
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.

Source§

fn from(value: &'s SubtreePathBuilder<'b, B>) -> Self

Converts to this type from the input type.
Source§

impl<'b, B: AsRef<[u8]>> Hash for SubtreePathBuilder<'b, B>

Hash order is the same as iteration order: from most deep path segment up to root.

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'bl, 'br, BL, BR> PartialEq<SubtreePath<'br, BR>> for SubtreePathBuilder<'bl, BL>
where BL: AsRef<[u8]>, BR: AsRef<[u8]>,

Source§

fn eq(&self, other: &SubtreePath<'br, BR>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'bl, 'br, BL, BR> PartialEq<SubtreePathBuilder<'br, BR>> for SubtreePath<'bl, BL>
where BL: AsRef<[u8]>, BR: AsRef<[u8]>,

Source§

fn eq(&self, other: &SubtreePathBuilder<'br, BR>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'bl, 'br, BL, BR> PartialEq<SubtreePathBuilder<'br, BR>> for SubtreePathBuilder<'bl, BL>
where BL: AsRef<[u8]>, BR: AsRef<[u8]>,

Source§

fn eq(&self, other: &SubtreePathBuilder<'br, BR>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'b, B: AsRef<[u8]>> Eq for SubtreePathBuilder<'b, B>

Auto Trait Implementations§

§

impl<'b, B> Freeze for SubtreePathBuilder<'b, B>

§

impl<'b, B> RefUnwindSafe for SubtreePathBuilder<'b, B>
where B: RefUnwindSafe,

§

impl<'b, B> Send for SubtreePathBuilder<'b, B>
where B: Sync,

§

impl<'b, B> Sync for SubtreePathBuilder<'b, B>
where B: Sync,

§

impl<'b, B> Unpin for SubtreePathBuilder<'b, B>

§

impl<'b, B> UnwindSafe for SubtreePathBuilder<'b, B>
where B: RefUnwindSafe,

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.