pub struct AICache { /* private fields */ }Expand description
AI analysis result cache
Implementations§
Source§impl AICache
impl AICache
Sourcepub async fn get(&self, key: &str) -> Option<MatchResult>
pub async fn get(&self, key: &str) -> Option<MatchResult>
Try to read a result from the cache
Sourcepub async fn set(&self, key: String, data: MatchResult)
pub async fn set(&self, key: String, data: MatchResult)
Write a new result into the cache
Sourcepub fn generate_key(request: &AnalysisRequest) -> String
pub fn generate_key(request: &AnalysisRequest) -> String
Generate a cache key based on the request
Auto Trait Implementations§
impl !Freeze for AICache
impl !RefUnwindSafe for AICache
impl Send for AICache
impl Sync for AICache
impl Unpin for AICache
impl !UnwindSafe for AICache
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