pub struct AutoloadCache { /* private fields */ }Implementations§
Source§impl AutoloadCache
impl AutoloadCache
pub fn open(path: &Path) -> Result<Self>
pub fn get(&self, name: &str) -> Option<Vec<u8>>
Sourcepub fn put_one(&self, name: &str, chunk_blob: Vec<u8>) -> Result<(), String>
pub fn put_one(&self, name: &str, chunk_blob: Vec<u8>) -> Result<(), String>
Single-write: read shard, insert one entry, write shard. Used by the cold-start path when a function is autoloaded before compinit pre-warm completes.
Sourcepub fn merge_in(&self, entries: HashMap<String, Vec<u8>>) -> Result<(), String>
pub fn merge_in(&self, entries: HashMap<String, Vec<u8>>) -> Result<(), String>
Merge entries into the existing shard, inserting/replacing each one.
Used by compinit’s BACKFILL path — when an existing shard is missing
some entries (e.g. binary mtime bump invalidated a subset), the
caller computes the missing names + chunks and merges them in
without touching unrelated entries. Single read + single write,
even for 16k entries.
Sourcepub fn replace_all(
&self,
entries: HashMap<String, Vec<u8>>,
) -> Result<(), String>
pub fn replace_all( &self, entries: HashMap<String, Vec<u8>>, ) -> Result<(), String>
Replace the entire shard with the given entries. Used by compinit’s bulk pre-warm — accumulate all (name, chunk_blob) pairs, then commit once. Avoids re-serializing 16k entries on every batch flush.
pub fn entry_count(&self) -> usize
Sourcepub fn cached_names(&self) -> HashSet<String>
pub fn cached_names(&self) -> HashSet<String>
Set of cached function names — caller can subtract this from “all known autoload names” to compute the missing-bytecode set without a SQL JOIN.
pub fn stats(&self) -> (i64, i64)
pub fn clear(&self) -> Result<()>
Auto Trait Implementations§
impl !Freeze for AutoloadCache
impl !RefUnwindSafe for AutoloadCache
impl Send for AutoloadCache
impl Sync for AutoloadCache
impl Unpin for AutoloadCache
impl UnsafeUnpin for AutoloadCache
impl UnwindSafe for AutoloadCache
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more