pub struct PluginCache { /* private fields */ }Expand description
SQLite-backed plugin cache.
Implementations§
Source§impl PluginCache
impl PluginCache
pub fn open(path: &Path) -> Result<Self>
Sourcepub fn check(
&self,
path: &str,
mtime_secs: i64,
mtime_nsecs: i64,
) -> Option<i64>
pub fn check( &self, path: &str, mtime_secs: i64, mtime_nsecs: i64, ) -> Option<i64>
Check if a cached entry exists with matching mtime AND the
running zshrs binary’s mtime is no newer than when the entry
was cached. Direct port of script_cache.rs’s invalidation
logic (lines 188-194): any zshrs rebuild silently invalidates
plugin-cached deltas because runtime semantics may have
shifted (paramsubst flags, option aliases, builtin
resolution, …). Without this guard, a new build reads stale
deltas and replays them with the new engine — visible
regression where zinit.zsh’s ${ZINIT[BIN_DIR]} returned
empty after re-source until the cache was manually cleared.
Sourcepub fn load(&self, plugin_id: i64) -> Result<PluginDelta>
pub fn load(&self, plugin_id: i64) -> Result<PluginDelta>
Load cached delta for a plugin by id.
Sourcepub fn store(
&self,
path: &str,
mtime_secs: i64,
mtime_nsecs: i64,
source_time_ms: u64,
delta: &PluginDelta,
) -> Result<()>
pub fn store( &self, path: &str, mtime_secs: i64, mtime_nsecs: i64, source_time_ms: u64, delta: &PluginDelta, ) -> Result<()>
Store a plugin delta. Replaces any existing entry for this path.
Sourcepub fn count_stale(&self) -> usize
pub fn count_stale(&self) -> usize
Count plugins whose file mtime no longer matches the cache.
Sourcepub fn check_compaudit(
&self,
dir: &str,
mtime_secs: i64,
mtime_nsecs: i64,
) -> Option<bool>
pub fn check_compaudit( &self, dir: &str, mtime_secs: i64, mtime_nsecs: i64, ) -> Option<bool>
Check if a directory’s security audit result is cached and still valid. Returns Some(is_secure) if cache hit, None if miss or stale.
Sourcepub fn store_compaudit(
&self,
dir: &str,
mtime_secs: i64,
mtime_nsecs: i64,
uid: u32,
mode: u32,
is_secure: bool,
) -> Result<()>
pub fn store_compaudit( &self, dir: &str, mtime_secs: i64, mtime_nsecs: i64, uid: u32, mode: u32, is_secure: bool, ) -> Result<()>
Store a compaudit result for a directory.
Sourcepub fn compaudit_cached(&self, fpath: &[PathBuf]) -> Vec<String>
pub fn compaudit_cached(&self, fpath: &[PathBuf]) -> Vec<String>
Run a full compaudit against fpath directories, using cache where valid. Returns list of insecure directories (empty = all secure).
Auto Trait Implementations§
impl !Freeze for PluginCache
impl !RefUnwindSafe for PluginCache
impl Send for PluginCache
impl !Sync for PluginCache
impl Unpin for PluginCache
impl UnsafeUnpin for PluginCache
impl !UnwindSafe for PluginCache
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