pub struct SessionNavigator { /* private fields */ }Expand description
Session navigator for tree-based session management
Implementations§
Sourcepub fn new() -> SessionNavigator
pub fn new() -> SessionNavigator
Create a new session navigator
Sourcepub fn from_entries(
entries: Vec<SessionEntryType>,
leaf_id: Option<Uuid>,
) -> SessionNavigator
pub fn from_entries( entries: Vec<SessionEntryType>, leaf_id: Option<Uuid>, ) -> SessionNavigator
Create from existing entries
Sourcepub fn get_leaf_id(&self) -> Option<Uuid>
pub fn get_leaf_id(&self) -> Option<Uuid>
Get the current leaf ID
Sourcepub fn get_entry(&self, id: Uuid) -> Option<&SessionEntryType>
pub fn get_entry(&self, id: Uuid) -> Option<&SessionEntryType>
Get an entry by ID
Sourcepub fn get_entries(&self) -> Vec<&SessionEntryType>
pub fn get_entries(&self) -> Vec<&SessionEntryType>
Get all entries
Sourcepub fn get_branch(&self, from_id: Option<Uuid>) -> Vec<&SessionEntryType>
pub fn get_branch(&self, from_id: Option<Uuid>) -> Vec<&SessionEntryType>
Get the branch path from root to a given entry
Sourcepub fn get_children(&self, parent_id: Uuid) -> Vec<&SessionEntryType>
pub fn get_children(&self, parent_id: Uuid) -> Vec<&SessionEntryType>
Get all direct children of an entry
Sourcepub fn collect_entries_for_branch_summary(
&self,
old_leaf_id: Option<Uuid>,
target_id: Uuid,
) -> CollectEntriesResult
pub fn collect_entries_for_branch_summary( &self, old_leaf_id: Option<Uuid>, target_id: Uuid, ) -> CollectEntriesResult
Collect entries that should be summarized when navigating from one position to another.
Navigate to a target entry in the session tree.
Sourcepub fn branch(&mut self, branch_from_id: Uuid)
pub fn branch(&mut self, branch_from_id: Uuid)
Switch to a different entry (start a new branch).
Sourcepub fn reset_leaf(&mut self)
pub fn reset_leaf(&mut self)
Reset the leaf pointer to null (before any entries).
Sourcepub fn branch_with_summary(
&mut self,
branch_from_id: Option<Uuid>,
summary: String,
details: Option<BranchSummaryDetails>,
from_hook: bool,
) -> Uuid
pub fn branch_with_summary( &mut self, branch_from_id: Option<Uuid>, summary: String, details: Option<BranchSummaryDetails>, from_hook: bool, ) -> Uuid
Start a new branch with a summary of the abandoned path.
Sourcepub fn append_label_change(
&mut self,
target_id: Uuid,
label: Option<String>,
) -> Uuid
pub fn append_label_change( &mut self, target_id: Uuid, label: Option<String>, ) -> Uuid
Set or clear a label on an entry.
Sourcepub fn add_entry(&mut self, entry: SessionEntryType)
pub fn add_entry(&mut self, entry: SessionEntryType)
Add an entry to the session
Sourcepub fn get_label_timestamp(&self, id: Uuid) -> Option<i64>
pub fn get_label_timestamp(&self, id: Uuid) -> Option<i64>
Get the label timestamp for an entry, if any
Trait Implementations§
Source§fn default() -> SessionNavigator
fn default() -> SessionNavigator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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