pub struct EpisodeStorage { /* private fields */ }Expand description
SQLite-based storage for episode metadata
Implementations§
Source§impl EpisodeStorage
impl EpisodeStorage
Sourcepub fn open(path: &Path) -> MemoryResult<Self>
pub fn open(path: &Path) -> MemoryResult<Self>
Open or create a storage database
Sourcepub fn in_memory() -> MemoryResult<Self>
pub fn in_memory() -> MemoryResult<Self>
Create an in-memory storage (for testing)
Sourcepub fn store_episode(&self, episode: &Episode) -> MemoryResult<()>
pub fn store_episode(&self, episode: &Episode) -> MemoryResult<()>
Store an episode
Sourcepub fn get_episode(&self, id: Uuid) -> MemoryResult<Option<Episode>>
pub fn get_episode(&self, id: Uuid) -> MemoryResult<Option<Episode>>
Get an episode by ID
Sourcepub fn list_episodes(&self, project: Option<&str>) -> MemoryResult<Vec<Episode>>
pub fn list_episodes(&self, project: Option<&str>) -> MemoryResult<Vec<Episode>>
List all episodes, optionally filtered by project
Sourcepub fn update_utility(&self, id: Uuid, utility: f64) -> MemoryResult<()>
pub fn update_utility(&self, id: Uuid, utility: f64) -> MemoryResult<()>
Update episode utility score
Sourcepub fn record_feedback(
&self,
episode_id: Uuid,
helpful: bool,
) -> MemoryResult<()>
pub fn record_feedback( &self, episode_id: Uuid, helpful: bool, ) -> MemoryResult<()>
Record feedback for an episode
Sourcepub fn get_feedback(&self, episode_id: Uuid) -> MemoryResult<Vec<Feedback>>
pub fn get_feedback(&self, episode_id: Uuid) -> MemoryResult<Vec<Feedback>>
Get all feedback for an episode
Sourcepub fn get_all_episode_ids(&self) -> MemoryResult<Vec<Uuid>>
pub fn get_all_episode_ids(&self) -> MemoryResult<Vec<Uuid>>
Get episode IDs for utility propagation
Sourcepub fn get_stats(&self, project: Option<&str>) -> MemoryResult<MemoryStats>
pub fn get_stats(&self, project: Option<&str>) -> MemoryResult<MemoryStats>
Get statistics about the memory
Auto Trait Implementations§
impl Freeze for EpisodeStorage
impl RefUnwindSafe for EpisodeStorage
impl Send for EpisodeStorage
impl Sync for EpisodeStorage
impl Unpin for EpisodeStorage
impl UnsafeUnpin for EpisodeStorage
impl UnwindSafe for EpisodeStorage
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> 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