serve

Web server configuration ([serve] table). Web server configuration ([serve] table).

Web server configuration ([serve] table). Web server configuration ([serve] table).

struct Settings

source

pub struct Settings

Settings from the [serve] configuration table.

Field Type Description
bind_address IpAddr IP address the server should bind to.
csrf_signing_key Option<String> Hex-encoded 32-byte HMAC key used to sign CSRF cookies. Auto-generated and persisted to the global config file on first startup when absent. Rotating the key invalidates every outstanding CSRF cookie on the next request, which will be reissued transparently.
debounce_ms u64 File watcher debounce window in milliseconds.
log_level Option<LevelFilter> Optional log level override applied while gest serve is running.
open bool Whether to automatically open the browser when the server starts.
port u16 Port the server should listen on.

Implements Clone, Debug, Deserialize<'de>, PartialEq, Serialize, Default.

Settings::bind_address

source

pub fn bind_address(&self) -> IpAddr

IP address the server should bind to.

Parameter Type Description
returns IpAddr

Settings::debounce_ms

source

pub fn debounce_ms(&self) -> u64

File watcher debounce window in milliseconds.

Parameter Type Description
returns u64

Settings::log_level

source

pub fn log_level(&self) -> Option<LevelFilter>

Optional log level override applied while gest serve is running.

Parameter Type Description
returns Option<LevelFilter>

Settings::open

source

pub fn open(&self) -> bool

Whether to automatically open the browser when the server starts.

Parameter Type Description
returns bool

Settings::port

source

pub fn port(&self) -> u16

Port the server should listen on.

Parameter Type Description
returns u16

Settings::csrf_signing_key

source

pub fn csrf_signing_key(&self) -> Option<&str>

Hex-encoded HMAC signing key used by the CSRF middleware.

Parameter Type Description
returns Option<&str> The configured key, or None before one has been generated and saved.