pub struct Tree { /* private fields */ }Implementations§
Source§impl Tree
impl Tree
pub fn new() -> Self
pub fn push( &mut self, parent: Option<NodeId>, name: impl Into<String>, is_container: bool, action: ActionValues, ) -> NodeId
pub fn push_with_detail( &mut self, parent: Option<NodeId>, name: impl Into<String>, detail: Option<String>, is_container: bool, action: ActionValues, ) -> NodeId
Sourcepub fn fully_indexed(&self) -> bool
pub fn fully_indexed(&self) -> bool
True once every node’s children are loaded and every span validated; the jump picker requires this.
Sourcepub fn pending(&self) -> usize
pub fn pending(&self) -> usize
Nodes whose children/validation are still pending (progress display).
Sourcepub fn detail(&self, id: NodeId) -> Option<String>
pub fn detail(&self, id: NodeId) -> Option<String>
Optional secondary text rendered after the name.
pub fn parent(&self, id: NodeId) -> Option<NodeId>
Sourcepub fn is_container(&self, id: NodeId) -> bool
pub fn is_container(&self, id: NodeId) -> bool
Whether the node represents a container, including an empty one.
Sourcepub fn children_of(&self, id: NodeId) -> &[NodeId] ⓘ
pub fn children_of(&self, id: NodeId) -> &[NodeId] ⓘ
The node’s children, in display order.
Sourcepub fn alternate_output(&self, id: NodeId) -> OsString
pub fn alternate_output(&self, id: NodeId) -> OsString
Text written to stdout by the alternate accept action.
Sourcepub fn filesystem_path(&self, id: NodeId) -> Option<OsString>
pub fn filesystem_path(&self, id: NodeId) -> Option<OsString>
The node’s location in the host filesystem, when it has one. JSON nodes are addressed by pointer within a document, so nothing outside ite can open them.
Sourcepub fn relpath(&self, id: NodeId) -> OsString
pub fn relpath(&self, id: NodeId) -> OsString
Value exported to shell bindings as $relpath: the address within the
source’s natural unit — the scan root for directories, the document
for JSON, the containing record for JSONL (the record itself is “”).
Sourcepub fn jump_key(&self, id: NodeId) -> String
pub fn jump_key(&self, id: NodeId) -> String
The text the jump picker matches and displays: the node’s
document-global address. Coincides with relpath for directory scans
and JSON documents; JSONL diverges, since a record-relative relpath
repeats across records.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn root_ids(&self) -> &[NodeId] ⓘ
Trait Implementations§
Source§impl TreeModel for Tree
impl TreeModel for Tree
Source§fn roots(&self) -> impl Iterator<Item = NodeId> + '_
fn roots(&self) -> impl Iterator<Item = NodeId> + '_
Source§fn children(&self, id: NodeId) -> TreeChildren<'_, NodeId>
fn children(&self, id: NodeId) -> TreeChildren<'_, NodeId>
Source§fn revision(&self) -> TreeRevision
fn revision(&self) -> TreeRevision
Auto Trait Implementations§
impl Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnsafeUnpin for Tree
impl UnwindSafe for Tree
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> 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>
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>
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