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
impl ConvoIO
pub fn new() -> Self
pub fn with_resolver(resolver: PathResolver) -> Self
pub fn resolver(&self) -> &PathResolver
pub fn exists(&self) -> bool
pub fn db_path(&self) -> Result<PathBuf>
Sourcepub fn list_projects(&self) -> Result<Vec<Project>>
pub fn list_projects(&self) -> Result<Vec<Project>>
List every project in the database.
Sourcepub fn list_sessions(&self, project_id: Option<&str>) -> Result<Vec<Session>>
pub fn list_sessions(&self, project_id: Option<&str>) -> Result<Vec<Session>>
List every session, optionally filtered by project id.
Sourcepub fn list_session_metadata(
&self,
project_id: Option<&str>,
) -> Result<Vec<SessionMetadata>>
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.
Sourcepub fn read_session(&self, session_id: &str) -> Result<Session>
pub fn read_session(&self, session_id: &str) -> Result<Session>
Load one session fully (messages + parts attached).
Sourcepub fn read_metadata(&self, session_id: &str) -> Result<SessionMetadata>
pub fn read_metadata(&self, session_id: &str) -> Result<SessionMetadata>
Return one session’s metadata by id.
pub fn session_exists(&self, session_id: &str) -> Result<bool>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConvoIO
impl RefUnwindSafe for ConvoIO
impl Send for ConvoIO
impl Sync for ConvoIO
impl Unpin for ConvoIO
impl UnsafeUnpin for ConvoIO
impl UnwindSafe for ConvoIO
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