pub struct BranchMemory {
pub branch_name: String,
pub created_at: DateTime<Utc>,
pub last_visited: DateTime<Utc>,
pub last_focus: Option<FileFocus>,
pub notes: Vec<String>,
pub session_count: u32,
pub total_commits: u32,
}Expand description
Per-branch persistent memory
Fields§
§branch_name: StringBranch name
created_at: DateTime<Utc>When this branch was first visited
last_visited: DateTime<Utc>When this branch was last visited
last_focus: Option<FileFocus>Last focused file and line
notes: Vec<String>User notes for this branch
session_count: u32Number of sessions on this branch
total_commits: u32Number of commits made on this branch (across sessions)
Implementations§
Source§impl BranchMemory
impl BranchMemory
Sourcepub fn record_visit(&mut self)
pub fn record_visit(&mut self)
Record a new session visit
Sourcepub fn clear_focus(&mut self)
pub fn clear_focus(&mut self)
Clear focus
Sourcepub fn record_commit(&mut self)
pub fn record_commit(&mut self)
Record a commit
Sourcepub fn time_since_last_visit(&self) -> Duration
pub fn time_since_last_visit(&self) -> Duration
Time since last visit
Sourcepub fn is_returning_visit(&self) -> bool
pub fn is_returning_visit(&self) -> bool
Check if this is a returning visit (visited before more than 5 minutes ago)
Sourcepub fn welcome_message(&self) -> Option<String>
pub fn welcome_message(&self) -> Option<String>
Generate a welcome message if returning
Trait Implementations§
Source§impl Clone for BranchMemory
impl Clone for BranchMemory
Source§fn clone(&self) -> BranchMemory
fn clone(&self) -> BranchMemory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BranchMemory
impl Debug for BranchMemory
Source§impl<'de> Deserialize<'de> for BranchMemory
impl<'de> Deserialize<'de> for BranchMemory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BranchMemory
impl RefUnwindSafe for BranchMemory
impl Send for BranchMemory
impl Sync for BranchMemory
impl Unpin for BranchMemory
impl UnwindSafe for BranchMemory
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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> 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