pub struct Partial {Show 14 fields
pub log_level: Option<LogLevel>,
pub token: Option<String>,
pub listeners: Option<Vec<ListenAddress>>,
pub statistics: Option<StatisticCategories>,
pub default_certificate: Option<DefaultCertificateSource>,
pub certificates: Option<Vec<CertificateSource>>,
pub hsts: Option<PartialHsts>,
pub hsts_max_age: Option<u32>,
pub https_redirect: Option<bool>,
pub send_alt_svc: Option<bool>,
pub send_server: Option<bool>,
pub send_csp: Option<bool>,
pub store: Option<BackendType>,
pub store_config: Option<HashMap<String, String>>,
}
Expand description
Links redirector configuration as seen from the user’s perspective.
This is easier to parse, but less idiomatic and not as easy to use as
Config
. As this is a representation of links’
configuration from one source only, all fields are optional, which allows
incremental updates to the actual Config
struct.
Fields§
§log_level: Option<LogLevel>
Minimum level of logs to be collected/displayed. Debug and trace levels may expose secret information, so are not recommended for production deployments.
token: Option<String>
API token, used for authentication of gRPC clients
listeners: Option<Vec<ListenAddress>>
Listener addresses, see ListenAddress
for details
statistics: Option<StatisticCategories>
What types of statistics should be collected
default_certificate: Option<DefaultCertificateSource>
Default TLS certificate and key source
certificates: Option<Vec<CertificateSource>>
TLS certificate and key sources
hsts: Option<PartialHsts>
HTTP Strict Transport Security setting on redirect
hsts_max_age: Option<u32>
HTTP Strict Transport Security max_age
header attribute (retention
time in seconds)
https_redirect: Option<bool>
Redirect from HTTP to HTTPS before the external redirect
send_alt_svc: Option<bool>
Send the Alt-Svc
header advertising h2
(HTTP/2.0 with TLS) support
on port 443
send_server: Option<bool>
Send the Server
header
send_csp: Option<bool>
Send the Content-Security-Policy
header
store: Option<BackendType>
The store backend type
store_config: Option<HashMap<String, String>>
The store backend configuration. All of these options are
backend-specific, and have ASCII alphanumeric string keys in
snake_case
(lower case, words seperated by underscores), without any
hyphens (-
), i.e. only lowercase a-z
, 0-9
, and _
are
allowed. The values are UTF-8 strings in any format.
Implementations§
Source§impl Partial
impl Partial
Sourcepub fn from_toml(toml: &str) -> Result<Self, IntoPartialError>
pub fn from_toml(toml: &str) -> Result<Self, IntoPartialError>
Sourcepub fn from_yaml(yaml: &str) -> Result<Self, IntoPartialError>
pub fn from_yaml(yaml: &str) -> Result<Self, IntoPartialError>
Sourcepub fn from_json(json: &str) -> Result<Self, IntoPartialError>
pub fn from_json(json: &str) -> Result<Self, IntoPartialError>
Sourcepub fn from_file(path: &Path) -> Result<Self, IntoPartialError>
pub fn from_file(path: &Path) -> Result<Self, IntoPartialError>
Read and parse a configuration file into a Partial
. The format of
the file is determined from its extension:
*.toml
files are parsed as toml*.yaml
and*.yml
files are parsed as yaml*.json
files are parsed as json
§IO
This function performs synchronous file IO, and should not be used in an asynchronous context.
§Errors
Returns an error when reading of parsing the file fails.
Sourcepub fn from_args() -> Self
pub fn from_args() -> Self
Parse command-line arguments into a Partial
. Listeners and store
configuration are parsed from json strings.
Sourcepub fn from_env_vars() -> Self
pub fn from_env_vars() -> Self
Parse environment variables with the prefix LINKS_
into a Partial
.
Listeners and store configuration are parsed from json strings.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Partial
impl<'de> Deserialize<'de> for Partial
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Partial
impl StructuralPartialEq for Partial
Auto Trait Implementations§
impl Freeze for Partial
impl RefUnwindSafe for Partial
impl Send for Partial
impl Sync for Partial
impl Unpin for Partial
impl UnwindSafe for Partial
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request