Skip to main content

ResolvedCachePolicy

Struct ResolvedCachePolicy 

Source
pub struct ResolvedCachePolicy {
    pub cache_name: String,
    pub ttl: Option<String>,
    pub key_params: Vec<String>,
    pub fingerprint: String,
    pub output_type: String,
}
Expand description

Everything the dispatch path needs to key ONE memoised call, resolved from the IRProgram once, when the plan is built.

§Why this type exists

CacheRuntime::dispatch took &IRProgram because resolve_tool_cache needs the whole module to answer “which cache governs this tool?” — the default-policy rule is a property of the module, not of the tool. But DispatchCtx carries no IRProgram, deliberately: it carries narrow, pre-resolved catalogs (credentials, anchors, the v2.69.0 shield policies) so the hot path looks nothing up that could have been looked up once.

Threading the IR through the runtime to satisfy one call would have inverted that, and for no gain: the answer cannot change between the deploy and the call. So resolution moves to where the IR already is, and the runtime receives the answer.

This is the v2.69.0 collect_shield_policies shape, and it is also the v2.87.0 discipline — resolve_tool_cache stays the ONE place that decides, and gains a second caller rather than a second copy.

Fields§

§cache_name: String

The governing cache’s name — also the backend NAMESPACE, so invalidate flushes exactly this cache’s entries.

§ttl: Option<String>

Raw TTL literal ("5m"); None ⇒ cache-forever, sound only because axon-T865 proved the memoised thing deterministic.

§key_params: Vec<String>

The key: subset; empty ⇒ every bound argument keys the entry.

§fingerprint: String

The declaration fingerprint — a redeploy that changes what is memoised changes this, so a behaviour change can never be served a result cached under the old behaviour.

§output_type: String

Part of the key so two tools with identical arguments but different result types never collide.

Implementations§

Source§

impl ResolvedCachePolicy

Source

pub fn for_retrieve(cache: &IRCache, store_name: &str) -> Self

v2.89.0 — the policy governing a retrieve … cache: <Name>.

A retrieve names its cache directly, so there is no eligibility question to resolve — but it still needs a fingerprint, and the honest one is the STORE it reads. A redeploy that changes the store’s shape must not serve rows cached against the old one, exactly as a changed tool declaration must not. axon-T865 already forces a finite ttl: here, because a store read is never pure.

Trait Implementations§

Source§

impl Clone for ResolvedCachePolicy

Source§

fn clone(&self) -> ResolvedCachePolicy

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResolvedCachePolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ResolvedCachePolicy

Source§

impl PartialEq for ResolvedCachePolicy

Source§

fn eq(&self, other: &ResolvedCachePolicy) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResolvedCachePolicy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more