Skip to main content

WarmState

Struct WarmState 

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

Memoized check state shared between the accept loop and the watcher.

Implementations§

Source§

impl WarmState

Source

pub fn new(manifest: Manifest) -> Self

Source

pub fn share(&self) -> Self

A handle to the same underlying state (memo, manifest, hit counter are shared, not copied) — one per connection task.

Source

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.

Source

pub fn hits(&self) -> u64

Memo hits since construction.

Source

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).

Source

pub fn invalidate_path(&self, path: &str)

Drop memoized verdicts for one path; untouched paths stay warm.

Source

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.

Source

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.

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 = 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.