pub struct ServerState {Show 49 fields
pub bind_ip: [u8; 4],
pub base_dir: PathBuf,
pub canonical_base_dir: Option<PathBuf>,
pub static_folder: String,
pub markdown_extensions: Vec<String>,
pub ignore_dirs: Vec<String>,
pub ignore_globs: Vec<String>,
pub index_file: String,
pub templates: Templates,
pub repo: Arc<Repo>,
pub oembed_timeout_ms: u64,
pub file_change_tx: Option<Sender<FileChangeEvent>>,
pub template_folder: Option<PathBuf>,
pub sort: Vec<SortField>,
pub gui_mode: bool,
pub theme: String,
pub oembed_cache: Arc<OembedCache>,
pub sibling_nav_cache: Arc<HashMap<PathBuf, Arc<Vec<Value>>>>,
pub subdir_cache: Arc<HashMap<PathBuf, Arc<Vec<Value>>>>,
pub site_json_cache: Arc<RwLock<SiteJsonCache>>,
pub link_tracking: bool,
pub relationship_tracking: bool,
pub relationship_types: Vec<RelationType>,
pub link_cache: Arc<LinkCache>,
pub inbound_link_cache: Arc<InboundLinkCache>,
pub inbound_index: Arc<InboundIndex>,
pub inbound_grep_semaphore: Arc<Semaphore>,
pub inbound_grep_inflight: Arc<HashMap<String, Arc<Notify>>>,
pub tag_sources: Vec<TagSource>,
pub sidebar_style: String,
pub sidebar_max_items: usize,
pub graph_depth: usize,
pub flashcards_concentric_threshold: f64,
pub flashcards_progress_indicators: bool,
pub title_prefix: String,
pub title_suffix: String,
pub mark_incomplete: bool,
pub incomplete_markers: Vec<String>,
pub tasks_enabled: bool,
pub review_enabled: bool,
pub tasks_stamp_done: bool,
pub tasks_default_include: IncludeFilter,
pub task_index: Arc<TaskIndex>,
pub edit_enabled: bool,
pub edit_require_token_on_loopback: bool,
pub edit_token_hash: Option<String>,
pub upload_max_bytes: usize,
pub config_problem: Option<String>,
pub file_write_locks: Arc<FileWriteLocks>,
}Fields§
§bind_ip: [u8; 4]IPv4 address the server was configured to bind. Used to validate the
Host header on editing requests (anti DNS-rebinding).
base_dir: PathBuf§canonical_base_dir: Option<PathBuf>Pre-computed canonical base directory for path resolution (avoids per-request canonicalize)
static_folder: String§markdown_extensions: Vec<String>§ignore_dirs: Vec<String>§ignore_globs: Vec<String>§index_file: String§templates: Templates§repo: Arc<Repo>§oembed_timeout_ms: u64§file_change_tx: Option<Sender<FileChangeEvent>>§template_folder: Option<PathBuf>Optional template folder that overrides default .mbr/ and compiled defaults
sort: Vec<SortField>Sort configuration for file listings
gui_mode: boolWhether the server is running in GUI mode (native window) vs browser mode
theme: StringTheme for Pico CSS selection (e.g., “default”, “amber”, “fluid”, “fluid.jade”)
oembed_cache: Arc<OembedCache>Cache for OEmbed page metadata to avoid redundant network requests
Per-directory memoized sibling navigation lists (prev/next). Avoids an O(repo) scan on every markdown render; invalidated when files change.
Doubles as the file half of a directory listing: the listing for a directory is exactly the sorted sibling list of the files it contains.
subdir_cache: Arc<HashMap<PathBuf, Arc<Vec<Value>>>>Per-directory memoized immediate-subdirectory lists, the other half of a
directory listing. Invalidated alongside sibling_nav_cache.
site_json_cache: Arc<RwLock<SiteJsonCache>>Fully rendered /.mbr/site.json body.
The payload is a pure function of the repository index, but mbr is a
multi-page app: shared.ts fetches it on every navigation, and
rebuilding it re-serializes every markdown file’s frontmatter each time.
Cleared whenever the repo changes (alongside sibling_nav_cache) and
rebuilt lazily on the next request.
link_tracking: boolWhether bidirectional link tracking is enabled
relationship_tracking: boolWhether typed relationship tracking is enabled
relationship_types: Vec<RelationType>Configured relation types (for directory-scan temp repos + site.json)
link_cache: Arc<LinkCache>Cache for outbound links extracted during page renders
inbound_link_cache: Arc<InboundLinkCache>Cache for inbound links discovered via grep
inbound_index: Arc<InboundIndex>Repository-wide backlink index, built once in the background after the
initial scan and maintained incrementally by the watcher. Until it
reports ready, links.json falls back to the per-page grep below.
inbound_grep_semaphore: Arc<Semaphore>Bounds concurrent inbound-link greps: each cache miss walks the whole repository, and the sidebar mini graph fans out many links.json requests at once, so at most two full-repo walks run at a time.
inbound_grep_inflight: Arc<HashMap<String, Arc<Notify>>>Single-flight guard for inbound-link greps: maps a page URL path to a
Notify while a grep is in progress, so N concurrent links.json
requests for the same page trigger one repo walk (others await).
tag_sources: Vec<TagSource>Tag sources for frontmatter extraction
Sidebar navigation style (“panel” for mbr-browse, “single” for mbr-browse-single)
Maximum items per section in sidebar navigation
graph_depth: usizeDepth (hops) of the sidebar mini graph neighborhood (1-5)
flashcards_concentric_threshold: f64Concentric-mode growth threshold, for __MBR_CONFIG__.
flashcards_progress_indicators: boolWhether flashcard notes draw reading-view progress indicators.
title_prefix: StringText to prepend to all page titles
title_suffix: StringText to append to all page titles
mark_incomplete: boolHighlight blocks beginning with TK/TODO/FIXME/XXX (default on in server/GUI).
incomplete_markers: Vec<String>Marker strings used by the incomplete-block highlighter.
tasks_enabled: boolWhether the task browser (POST /.mbr/tasks) is enabled.
review_enabled: boolWhether block elements carry data-mbr-line source lines.
tasks_stamp_done: boolWhether POST /.mbr/task maintains the @done(...) annotation when it
toggles a task’s status.
tasks_default_include: IncludeFilterWhere the task panel’s Show filter starts (tasks/markers/all).
Reaches the frontend as window.__MBR_CONFIG__.tasksDefaultInclude;
the query endpoint itself has no opinion, since the panel always sends
an explicit include.
task_index: Arc<TaskIndex>Lazy index of the repository’s markdown tasks.
Deliberately not built at startup: it is filled on the first task query and then kept fresh by the watcher, so a server whose user never opens the task panel never pays for a full-repo read pass.
edit_enabled: boolWhether the in-browser markdown editing endpoints are enabled.
edit_require_token_on_loopback: boolRequire the editing token even for loopback callers.
edit_token_hash: Option<String>Argon2 PHC hash of the shared editing token (never sent to the frontend).
upload_max_bytes: usizeMaximum size in bytes of a single asset uploaded via /.mbr/upload.
config_problem: Option<String>§file_write_locks: Arc<FileWriteLocks>Serializes read-patch-write cycles on one file across the in-place
write endpoints (/.mbr/edit, /.mbr/task, /.mbr/flashcard-review).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ServerState
impl !UnwindSafe for ServerState
impl Freeze for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl UnsafeUnpin for ServerState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);