pub struct ServerConfig {Show 42 fields
pub ip: [u8; 4],
pub port: u16,
pub base_dir: PathBuf,
pub static_folder: String,
pub markdown_extensions: Vec<String>,
pub ignore_dirs: Vec<String>,
pub ignore_globs: Vec<String>,
pub watcher_ignore_dirs: Vec<String>,
pub explicit_hidden_dirs: Vec<PathBuf>,
pub symlink_mounts: bool,
pub index_file: String,
pub oembed_timeout_ms: u64,
pub oembed_cache_size: usize,
pub template_folder: Option<PathBuf>,
pub sort: Vec<SortField>,
pub gui_mode: bool,
pub theme: String,
pub log_filter: Option<String>,
pub link_tracking: bool,
pub relationship_tracking: bool,
pub relationship_types: Vec<RelationType>,
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 tasks_ignore_globs: Vec<String>,
pub edit_enabled: bool,
pub edit_require_token_on_loopback: bool,
pub edit_token_hash: Option<String>,
pub upload_max_bytes: usize,
pub embedded: Option<EmbeddedStorage>,
pub config_problem: Option<String>,
}Expand description
Configuration for initializing a Server instance.
This struct consolidates all parameters needed by Server::init,
making it easier to construct and pass around configuration.
§Example
use mbr_server::server::ServerConfig;
use mbr_core::config::Config;
let config = Config::default();
let server_config = ServerConfig::from(&config)
.with_gui_mode(false)
.with_log_filter(Some("mbr=debug"));
let server = Server::init(server_config)?;Fields§
§ip: [u8; 4]§port: u16§base_dir: PathBuf§static_folder: String§markdown_extensions: Vec<String>§ignore_dirs: Vec<String>§ignore_globs: Vec<String>§watcher_ignore_dirs: Vec<String>Repo-relative hidden directories named on the command line, exempt from
the scanner’s and watcher’s leading-dot rule. See
mbr_core::config::explicit_hidden_dirs.
symlink_mounts: boolRead-only symlink mounts on (the default) or off
(Config::no_symlink_mounts, the operator’s kill switch).
index_file: String§oembed_timeout_ms: u64§oembed_cache_size: usize§template_folder: Option<PathBuf>§sort: Vec<SortField>§gui_mode: bool§theme: String§log_filter: Option<String>§link_tracking: bool§relationship_tracking: boolEnable typed relationship tracking.
relationship_types: Vec<RelationType>Configured relation types (for the relationship index + site.json).
tag_sources: Vec<TagSource>§graph_depth: usizeDepth (hops) of the sidebar mini graph neighborhood (1-5).
flashcards_concentric_threshold: f64Concentric-mode growth threshold for the flashcard deck (0 < t ≤ 1).
flashcards_progress_indicators: boolDraw review-progress indicators on flashcard notes’ reading view.
title_prefix: String§title_suffix: String§mark_incomplete: boolHighlight blocks beginning with an incomplete marker (TK/TODO/FIXME/XXX).
incomplete_markers: Vec<String>Marker strings used by the incomplete-block highlighter.
tasks_enabled: boolEnable the task browser (POST /.mbr/tasks).
review_enabled: boolEmit data-mbr-line source lines on block elements.
tasks_stamp_done: boolMaintain the @done(...) annotation when POST /.mbr/task toggles a
task’s status.
tasks_default_include: IncludeFilterWhere the task panel’s Show filter starts (tasks/markers/all).
tasks_ignore_globs: Vec<String>Globs matched against repo-relative paths whose files are kept out of the
task index (e.g. templates/**). Empty by default.
edit_enabled: boolEnable the in-browser markdown editing endpoints.
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 (server-side only).
upload_max_bytes: usizeMaximum size in bytes of a single asset uploaded via /.mbr/upload.
embedded: Option<EmbeddedStorage>Storage (and optionally a saved index) supplied by an app that embeds
the server, instead of the directory scan of base_dir the desktop
does. None everywhere but the iOS app (mbr_ffi::mobile); see
EmbeddedStorage.
config_problem: Option<String>Why the repository’s configuration could not be loaded, when the
embedder fell back to the defaults instead of failing (the iOS app).
Reported on every page’s errors.json as config_parse_error.
Always None on the desktop, which refuses to start instead.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn with_gui_mode(self, gui_mode: bool) -> Self
pub fn with_gui_mode(self, gui_mode: bool) -> Self
Set whether the server is running in GUI mode (native window).
Sourcepub fn with_log_filter(self, filter: Option<&str>) -> Self
pub fn with_log_filter(self, filter: Option<&str>) -> Self
Set the log filter for tracing (e.g., “mbr=debug,tower_http=warn”).
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Auto Trait Implementations§
impl !RefUnwindSafe for ServerConfig
impl !UnwindSafe for ServerConfig
impl Freeze for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
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);