Skip to main content

ConvoIO

Struct ConvoIO 

Source
pub struct ConvoIO { /* private fields */ }
Expand description

The facade most consumers want. Wraps a PathResolver and lazily opens the database on demand.

Implementations§

Source§

impl ConvoIO

Source

pub fn new() -> Self

Source

pub fn with_resolver(resolver: PathResolver) -> Self

Source

pub fn resolver(&self) -> &PathResolver

Source

pub fn exists(&self) -> bool

Source

pub fn db_path(&self) -> Result<PathBuf>

Source

pub fn list_projects(&self) -> Result<Vec<Project>>

List every project in the database.

Source

pub fn list_sessions(&self, project_id: Option<&str>) -> Result<Vec<Session>>

List every session, optionally filtered by project id.

Source

pub fn list_session_metadata( &self, project_id: Option<&str>, ) -> Result<Vec<SessionMetadata>>

Lightweight per-session metadata. One DB query per session header + one aggregated query per session for the message count — cheap enough for interactive listing.

Source

pub fn read_session(&self, session_id: &str) -> Result<Session>

Load one session fully (messages + parts attached).

Source

pub fn read_metadata(&self, session_id: &str) -> Result<SessionMetadata>

Return one session’s metadata by id.

Source

pub fn session_exists(&self, session_id: &str) -> Result<bool>

Source

pub fn part_type_counts( &self, session_id: &str, ) -> Result<BTreeMap<String, usize>>

Discriminator counts across all parts in a session — useful for quick inspection / debugging.

Source

pub fn role_counts(&self, session_id: &str) -> Result<BTreeMap<String, usize>>

Total message-role counts. Handy for sanity checks.

Trait Implementations§

Source§

impl Default for ConvoIO

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.