Skip to main content

ExecutableCache

Struct ExecutableCache 

Source
pub struct ExecutableCache { /* private fields */ }
Expand description

Exact-input, byte-bounded, single-flight cache of vocabulary-neutral executables.

Implementations§

Source§

impl ExecutableCache

Source

pub fn new() -> Self

Empty cache with the production byte budget.

Source

pub fn with_budget(budget: usize) -> Self

Empty cache with an explicit byte budget.

Source

pub fn get_or_compile_json( &self, schema: &str, options: CompileOptions, ) -> Result<Arc<CachedExecutable>, CompileError>

Returns or compiles the exact JSON input and options. Digest equality only selects a bucket; ExactInputKey equality establishes identity.

Source

pub fn get_or_compile_schema_set( &self, schema: &str, retrieval_uri: Option<&str>, resources: &[(String, String)], options: CompileOptions, limits: SchemaResourceLimits, ) -> Result<Arc<CachedExecutable>, CompileError>

Returns or compiles an exact root, resource registry, options, and limit set.

Source

pub fn get_or_compile_wire( &self, wire: &[u8], ) -> Result<Arc<CachedExecutable>, CompileError>

Returns or decodes one exact MFIR wire input before semantic executable lookup.

Source

pub fn get_or_compile_ir( &self, ir: Arc<SchemaIR>, ) -> Result<Arc<CachedExecutable>, CompileError>

Returns or compiles one exact canonical IR independently of its source spelling.

Source

pub fn clear(&self)

Drops every ready entry, releasing their retained bytes; leaves in-flight builds running.

Source

pub fn stats(&self) -> ExecutableCacheStats

Current retention plus cumulative traffic.

Trait Implementations§

Source§

impl Default for ExecutableCache

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.