pub struct PrefixPath { /* private fields */ }Expand description
A retained path with immutable shared prefixes and a unique outer handle.
iter borrows segments; to_vec is an explicit temporary flat export.
Public mutation creates a new tail, preserving other cloned path snapshots.
Implementations§
Source§impl PrefixPath
impl PrefixPath
Sourcepub fn from_segments(segments: &[Seg]) -> Self
pub fn from_segments(segments: &[Seg]) -> Self
Construct without a pool. Use Engine::retained_path to share prefixes
across independently constructed container paths in one engine.
Sourcepub fn get(&self, index: usize) -> Option<&Seg>
pub fn get(&self, index: usize) -> Option<&Seg>
Indexed lookup walks backwards from the tail. Sequential consumers
should use iter, which constructs its borrowed traversal once.
Sourcepub fn iter(&self) -> PrefixPathIter<'_> ⓘ
pub fn iter(&self) -> PrefixPathIter<'_> ⓘ
Borrow segments in canonical order; deep paths use temporary references.
Sourcepub fn format(&self, rel_root: Option<&str>) -> String
pub fn format(&self, rel_root: Option<&str>) -> String
Format through the same canonical spelling as path_str, borrowing
segments and retaining no flat vector.
Sourcepub fn prefix_node_ids(&self) -> impl Iterator<Item = usize> + '_
pub fn prefix_node_ids(&self) -> impl Iterator<Item = usize> + '_
Borrowed ancestry identity for an external diagnostic only. This is not a stable language identity, and does not identify a reference snapshot.
Sourcepub fn prefix_nodes(&self) -> impl Iterator<Item = (usize, &Seg)> + '_
pub fn prefix_nodes(&self) -> impl Iterator<Item = (usize, &Seg)> + '_
Tail-to-root borrowed nodes for a deduplicating owner census. The tuple exposes each node’s segment owner without cloning or flattening paths.
Trait Implementations§
Source§impl Clone for PrefixPath
impl Clone for PrefixPath
Source§impl Debug for PrefixPath
impl Debug for PrefixPath
Source§impl Default for PrefixPath
impl Default for PrefixPath
Source§impl Drop for PrefixPath
Available on crate feature runtime-diagnostics only.
impl Drop for PrefixPath
runtime-diagnostics only.impl Eq for PrefixPath
Source§impl<'a> IntoIterator for &'a PrefixPath
impl<'a> IntoIterator for &'a PrefixPath
Auto Trait Implementations§
impl !Send for PrefixPath
impl !Sync for PrefixPath
impl Forget for PrefixPath
impl Freeze for PrefixPath
impl Move for PrefixPath
impl RefUnwindSafe for PrefixPath
impl Unpin for PrefixPath
impl UnsafeUnpin for PrefixPath
impl UnwindSafe for PrefixPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.