pub struct Session {
pub id: String,
pub name: String,
pub status: SessionStatus,
pub last_activity: u64,
pub message_count: usize,
pub has_changes: bool,
pub metadata: HashMap<String, String>,
}Expand description
Session information
Fields§
§id: StringUnique session identifier
name: StringSession name/title
status: SessionStatusSession status
last_activity: u64Last activity timestamp (seconds since epoch)
message_count: usizeNumber of messages in session
has_changes: boolWhether session has unsaved changes
metadata: HashMap<String, String>Session metadata
Implementations§
Source§impl Session
impl Session
Sourcepub fn set_status(&mut self, status: SessionStatus)
pub fn set_status(&mut self, status: SessionStatus)
Update session status
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark session as having changes
Sourcepub fn mark_clean(&mut self)
pub fn mark_clean(&mut self)
Mark session as clean
Sourcepub fn update_activity(&mut self)
pub fn update_activity(&mut self)
Update last activity timestamp
Sourcepub fn add_message(&mut self)
pub fn add_message(&mut self)
Increment message count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
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> 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