Struct General

Source
pub struct General {
Show 46 fields pub host: Option<String>, pub port: Option<u16>, pub root: Option<PathBuf>, pub log_level: Option<LogLevel>, pub log_with_ansi: Option<bool>, 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 directory_listing_download: Option<Vec<DirDownloadFmt>>, 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 log_x_real_ip: Option<bool>, pub log_forwarded_for: Option<bool>, pub trusted_proxies: Option<Vec<IpAddr>>, pub redirect_trailing_slash: Option<bool>, pub ignore_hidden_files: Option<bool>, pub disable_symlinks: 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>, pub memory_cache: Option<bool>,
}
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 level.

§log_with_ansi: Option<bool>

Enable/disable ANSI escape codes for log output.

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

§directory_listing_download: Option<Vec<DirDownloadFmt>>
Available on crate feature directory-listing-download only.

Directory listing download 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.

§log_x_real_ip: Option<bool>

Log the X-Real-IP header.

§log_forwarded_for: Option<bool>

Log the X-Forwarded-For header.

§trusted_proxies: Option<Vec<IpAddr>>

Trusted IPs for remote addresses.

§redirect_trailing_slash: Option<bool>

Redirect trailing slash feature.

§ignore_hidden_files: Option<bool>

Ignore hidden files feature.

§disable_symlinks: Option<bool>

Prevent following symbolic links of files or directories.

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

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

In-memory files cache feature.

Trait Implementations§

Source§

impl Clone for General

Source§

fn clone(&self) -> General

Returns a duplicate 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,