pub struct LessonsStore {
pub lessons: Vec<StoredLesson>,
pub last_updated: Option<String>,
}Expand description
Persistent store for lessons.
Fields§
§lessons: Vec<StoredLesson>§last_updated: Option<String>Implementations§
Source§impl LessonsStore
impl LessonsStore
Sourcepub fn project_path(project_id: &str) -> PathBuf
pub fn project_path(project_id: &str) -> PathBuf
Resolve the lessons path for a project.
Sourcepub fn load_project(project_id: &str) -> Self
pub fn load_project(project_id: &str) -> Self
Load project-scoped lessons.
Sourcepub fn save_project(&self, project_id: &str) -> Result<()>
pub fn save_project(&self, project_id: &str) -> Result<()>
Save project-scoped lessons.
Sourcepub fn add_lessons(&mut self, lessons: &[Lesson], session_id: &str)
pub fn add_lessons(&mut self, lessons: &[Lesson], session_id: &str)
Add lessons from a post-mortem analysis. Deduplicates by checking if a similar lesson already exists (same tags + trigger).
Sourcepub fn top_lessons(&self, n: usize) -> Vec<&StoredLesson>
pub fn top_lessons(&self, n: usize) -> Vec<&StoredLesson>
Get the top N lessons by occurrence count, for CLAUDE.md sync.
Sourcepub fn render_claude_md_section(&self, max_lessons: usize) -> String
pub fn render_claude_md_section(&self, max_lessons: usize) -> String
Render lessons as a markdown section for CLAUDE.md.
Trait Implementations§
Source§impl Clone for LessonsStore
impl Clone for LessonsStore
Source§fn clone(&self) -> LessonsStore
fn clone(&self) -> LessonsStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LessonsStore
impl Debug for LessonsStore
Source§impl Default for LessonsStore
impl Default for LessonsStore
Source§fn default() -> LessonsStore
fn default() -> LessonsStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LessonsStore
impl<'de> Deserialize<'de> for LessonsStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LessonsStore
impl RefUnwindSafe for LessonsStore
impl Send for LessonsStore
impl Sync for LessonsStore
impl Unpin for LessonsStore
impl UnsafeUnpin for LessonsStore
impl UnwindSafe for LessonsStore
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