pub struct WarmState { /* private fields */ }Expand description
Memoized check state shared between the accept loop and the watcher.
Implementations§
Source§impl WarmState
impl WarmState
pub fn new(manifest: Manifest) -> Self
A handle to the same underlying state (memo, manifest, hit counter are shared, not copied) — one per connection task.
Sourcepub fn check(&self, request: &WriteRequest) -> CheckResult
pub fn check(&self, request: &WriteRequest) -> CheckResult
Warm-or-compute a verdict. A hit returns the stored envelope for
the same (path, content); a miss computes with the SAME
check_write the cold path uses and stores the result.
Sourcepub fn swap_manifest(&self, manifest: Manifest)
pub fn swap_manifest(&self, manifest: Manifest)
Replace the manifest and drop every memoized verdict (mappings shape every verdict; nothing memoized survives a manifest change).
Sourcepub fn invalidate_path(&self, path: &str)
pub fn invalidate_path(&self, path: &str)
Drop memoized verdicts for one path; untouched paths stay warm.
Sourcepub fn watch(&self, root: &Path) -> Result<WatchGuard>
pub fn watch(&self, root: &Path) -> Result<WatchGuard>
Watch root recursively: a pushkin.toml change reloads the
manifest wholesale (parse failures keep the old manifest — a
half-saved edit must not tear down the gate); any other file
change invalidates that file’s memo entry, keyed by its
root-relative path.
§Errors
std::io::Error when the watcher cannot be created or attached.
Sourcepub fn watch_governing(
&self,
root: &Path,
governing: &Path,
) -> Result<WatchGuard>
pub fn watch_governing( &self, root: &Path, governing: &Path, ) -> Result<WatchGuard>
watch, with the governing manifest named explicitly (F73 phase 3).
Only governing reloads. Every other pushkin.toml under the watch
root is a file the daemon does not answer to — adopting one let an agent
disarm the gate by writing a file the gate permits, because
protected_paths = ["pushkin.toml"] does not match a nested path.
§Errors
std::io::Error when the watcher cannot be created or attached.