pub struct OpenAiPlanCache { /* private fields */ }Expand description
In-memory store of plan evaluation responses keyed by PlanCacheKey.
Implementations§
Source§impl OpenAiPlanCache
impl OpenAiPlanCache
Sourcepub fn get(&self, key: &PlanCacheKey) -> Option<&Expr>
pub fn get(&self, key: &PlanCacheKey) -> Option<&Expr>
Returns the cached response for key, or None when absent.
Sourcepub fn put(
&mut self,
cx: &mut Cx,
target: PlanCacheWriteTarget,
key: PlanCacheKey,
response: Expr,
) -> Result<()>
pub fn put( &mut self, cx: &mut Cx, target: PlanCacheWriteTarget, key: PlanCacheKey, response: Expr, ) -> Result<()>
Inserts a response under key, checking the cache capability when persistent.
Writes to PlanCacheWriteTarget::Persistent require the runner cache
capability and fail closed if it is not granted; memory writes always
succeed.
Trait Implementations§
Source§impl Clone for OpenAiPlanCache
impl Clone for OpenAiPlanCache
Source§fn clone(&self) -> OpenAiPlanCache
fn clone(&self) -> OpenAiPlanCache
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 OpenAiPlanCache
impl Debug for OpenAiPlanCache
Source§impl Default for OpenAiPlanCache
impl Default for OpenAiPlanCache
Source§fn default() -> OpenAiPlanCache
fn default() -> OpenAiPlanCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OpenAiPlanCache
impl RefUnwindSafe for OpenAiPlanCache
impl Send for OpenAiPlanCache
impl Sync for OpenAiPlanCache
impl Unpin for OpenAiPlanCache
impl UnsafeUnpin for OpenAiPlanCache
impl UnwindSafe for OpenAiPlanCache
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