pub struct BuildCache {
pub quiet: bool,
pub skip_clean: bool,
pub dev_mode: bool,
/* private fields */
}Expand description
Persistent state held by the dev server across rebuilds. The dev server always performs a full rebuild on every watcher tick — the previous incremental machinery proved too complex for the marginal time savings — so this struct exists solely to amortize startup costs that don’t depend on user-edited content.
Today that’s just the syntect Highlighter (the syntax + theme
load is ~30-50ms). One-shot CLI builds construct a fresh
BuildCache::default() and discard it.
Fields§
§quiet: boolSuppress per-step terminal output (✔ Rendered 31 pages, etc.).
The dev server flips this on after the first build so subsequent
rebuilds collapse into the rolling rebuild line.
skip_clean: boolSkip the remove_dir_all(out_dir) step. Files are overwritten
in place. Dev-mode optimization — saves the macOS-ENOTEMPTY
retry path and shaves disk I/O off every rebuild. Stale files
from deleted source pages survive until the next process restart.
dev_mode: boolDev-mode flag: when true, the bundler skips minification for
faster rebuilds during webui-press serve.
Implementations§
Source§impl BuildCache
impl BuildCache
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty cache with verbose output and clean-then-build
semantics. Subsequent calls to build_docs_with_cache will
populate it on first use.
Sourcepub fn set_dev_rebuild(&mut self)
pub fn set_dev_rebuild(&mut self)
Switch the cache into dev-server rebuild mode: suppresses per-step output banners and skips wiping the output directory.
Trait Implementations§
Source§impl Default for BuildCache
impl Default for BuildCache
Source§fn default() -> BuildCache
fn default() -> BuildCache
Auto Trait Implementations§
impl !Freeze for BuildCache
impl RefUnwindSafe for BuildCache
impl Send for BuildCache
impl Sync for BuildCache
impl Unpin for BuildCache
impl UnsafeUnpin for BuildCache
impl UnwindSafe for BuildCache
Blanket Implementations§
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<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