pub struct PersistedSession {
pub agent_id: String,
pub name: String,
pub messages: usize,
pub created_at: Option<u64>,
pub updated_at: Option<u64>,
}Expand description
A conversation mentra has on disk, as basis reports it.
basis’s own shape rather than a re-export of mentra’s PersistedAgentSummary,
for the same reason Event is basis’s own type: what basis
publishes should not move because a runtime internal did.
Fields§
§agent_id: StringThe persisted agent id, which is also the ACP session id (ADR-0007).
name: StringThe name the session was opened under.
messages: usizeHow many messages the conversation holds. Zero means it was opened and never used.
created_at: Option<u64>When the conversation was first written, in seconds since the epoch.
Optional because mentra’s summary is: a store that keeps nothing
across process lifetimes has no record and therefore no answer, and
basis carries that rather than inventing a number to fill the gap.
Nothing reached through list_in is one of those — listing opens a
file store of its own, whatever the workspace was running on — so in
practice both of these arrive set. list_in’s ordering still handles None, because a
rule that only works for the values it happens to see is not a rule.
updated_at: Option<u64>When it was last written, on the same clock and absent in the same case.
This is last persisted, not last spoken: mentra rewrites an agent’s
row on every turn and on every set_model, set_effort or set_name,
so it moves for a rename as readily as for an exchange. Close enough to
“last activity” to sort a list by, and not close enough to bill by.
Trait Implementations§
Source§impl Clone for PersistedSession
impl Clone for PersistedSession
Source§fn clone(&self) -> PersistedSession
fn clone(&self) -> PersistedSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PersistedSession
impl Debug for PersistedSession
impl Eq for PersistedSession
Source§impl PartialEq for PersistedSession
impl PartialEq for PersistedSession
impl StructuralPartialEq for PersistedSession
Auto Trait Implementations§
impl Freeze for PersistedSession
impl RefUnwindSafe for PersistedSession
impl Send for PersistedSession
impl Sync for PersistedSession
impl Unpin for PersistedSession
impl UnsafeUnpin for PersistedSession
impl UnwindSafe for PersistedSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.