gleaning_policy.rs
rust
1pub struct GleaningPolicy { /* ... */ }
2
3impl GleaningPolicy {
4 pub fn new(config: GleaningConfig) -> Result<Self, GleaningError>;
5 pub fn with_defaults() -> Self;
6
7 // Patch management
8 pub fn add_patch(&mut self, patch: Box<dyn RetrievalPatch>);
9 pub fn patch_count(&self) -> usize;
10
11 // Foraging
12 pub fn forage(&mut self, query: &str) -> Result<GleaningResult, GleaningError>;
13 pub fn record_outcome(&mut self, query: &str, quality: f32);
14
15 // Introspection
16 pub fn memory_stats(&self) -> MemoryStats;
17}
18
19impl Maintainable for GleaningPolicy {
20 fn tick(&mut self) -> MaintenanceReport;
21}
22