Struct static_web_server::settings::file::General

source ·
pub struct General {
Show 39 fields pub host: Option<String>, pub port: Option<u16>, pub root: Option<PathBuf>, pub log_level: Option<LogLevel>, pub cache_control_headers: Option<bool>, pub compression: Option<bool>, pub compression_level: Option<CompressionLevel>, pub compression_static: Option<bool>, pub page404: Option<PathBuf>, pub page50x: Option<PathBuf>, pub http2: Option<bool>, pub http2_tls_cert: Option<PathBuf>, pub http2_tls_key: Option<PathBuf>, pub https_redirect: Option<bool>, pub https_redirect_host: Option<String>, pub https_redirect_from_port: Option<u16>, pub https_redirect_from_hosts: Option<String>, pub security_headers: Option<bool>, pub cors_allow_origins: Option<String>, pub cors_allow_headers: Option<String>, pub cors_expose_headers: Option<String>, pub index_files: Option<String>, pub directory_listing: Option<bool>, pub directory_listing_order: Option<u8>, pub directory_listing_format: Option<DirListFmt>, pub basic_auth: Option<String>, pub fd: Option<usize>, pub threads_multiplier: Option<usize>, pub max_blocking_threads: Option<usize>, pub grace_period: Option<u8>, pub page_fallback: Option<PathBuf>, pub log_remote_address: Option<bool>, pub redirect_trailing_slash: Option<bool>, pub ignore_hidden_files: Option<bool>, pub health: Option<bool>, pub experimental_metrics: Option<bool>, pub maintenance_mode: Option<bool>, pub maintenance_mode_status: Option<u16>, pub maintenance_mode_file: Option<PathBuf>,
}
Expand description

General server options available in configuration file mode. Note that the --config-file option is excluded from itself.

Fields§

§host: Option<String>

Server address.

§port: Option<u16>

Server port.

§root: Option<PathBuf>

Root directory path.

§log_level: Option<LogLevel>

Logging.

§cache_control_headers: Option<bool>

Cache Control headers.

§compression: Option<bool>
Available on crate features compression or compression-gzip or compression-brotli or compression-zstd or compression-deflate only.

Compression.

§compression_level: Option<CompressionLevel>
Available on crate features compression or compression-gzip or compression-brotli or compression-zstd or compression-deflate only.

Compression level.

§compression_static: Option<bool>
Available on crate features compression or compression-gzip or compression-brotli or compression-zstd or compression-deflate only.

Check for a pre-compressed file on disk.

§page404: Option<PathBuf>

Error 404 pages.

§page50x: Option<PathBuf>

Error 50x pages.

§http2: Option<bool>
Available on crate feature http2 only.

HTTP/2 + TLS.

§http2_tls_cert: Option<PathBuf>
Available on crate feature http2 only.

Http2 tls certificate feature.

§http2_tls_key: Option<PathBuf>
Available on crate feature http2 only.

Http2 tls key feature.

§https_redirect: Option<bool>
Available on crate feature http2 only.

Redirect all HTTP requests to HTTPS.

§https_redirect_host: Option<String>
Available on crate feature http2 only.

HTTP host port where the redirect server will listen for requests to redirect them to HTTPS.

§https_redirect_from_port: Option<u16>
Available on crate feature http2 only.

Host port for redirecting HTTP requests to HTTPS.

§https_redirect_from_hosts: Option<String>
Available on crate feature http2 only.

List of host names or IPs allowed to redirect from.

§security_headers: Option<bool>

Security headers.

§cors_allow_origins: Option<String>

Cors allow origins feature.

§cors_allow_headers: Option<String>

Cors allow headers feature.

§cors_expose_headers: Option<String>

Cors expose headers feature.

§index_files: Option<String>

List of files to be used as an index for requests ending with the slash character (‘/’).

§directory_listing: Option<bool>
Available on crate feature directory-listing only.

Directory listing feature.

§directory_listing_order: Option<u8>
Available on crate feature directory-listing only.

Directory listing order feature.

§directory_listing_format: Option<DirListFmt>
Available on crate feature directory-listing only.

Directory listing format feature.

§basic_auth: Option<String>
Available on crate feature basic-auth only.

Basic Authentication feature.

§fd: Option<usize>

File descriptor binding feature.

§threads_multiplier: Option<usize>

Worker threads.

§max_blocking_threads: Option<usize>

Max blocking threads feature.

§grace_period: Option<u8>

Grace period feature.

§page_fallback: Option<PathBuf>
Available on crate feature fallback-page only.

Page fallback feature.

§log_remote_address: Option<bool>

Log remote address feature.

§redirect_trailing_slash: Option<bool>

Redirect trailing slash feature.

§ignore_hidden_files: Option<bool>

Ignore hidden files feature.

§health: Option<bool>

Health endpoint feature.

§experimental_metrics: Option<bool>
Available on Unix and crate feature experimental only.

Metrics endpoint feature (experimental).

§maintenance_mode: Option<bool>

Maintenance mode feature.

§maintenance_mode_status: Option<u16>

Custom HTTP status for when entering into maintenance mode.

§maintenance_mode_file: Option<PathBuf>

Custom maintenance mode HTML file.

Trait Implementations§

source§

impl Clone for General

source§

fn clone(&self) -> General

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for General

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for General

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for General

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,