[][src]Struct xaynet_server::settings::ApiSettings

pub struct ApiSettings {
    pub bind_address: SocketAddr,
    pub tls_certificate: Option<PathBuf>,
    pub tls_key: Option<PathBuf>,
    // some fields omitted
}

REST API settings.

Requires at least one of the following arguments if the tls feature is enabled:

  • tls_certificate together with tls_key for TLS server authentication

Fields

bind_address: SocketAddr

The address to which the REST API should be bound.

Examples

TOML

[api]
bind_address = "0.0.0.0:8081"
# or
bind_address = "127.0.0.1:8081"

Environment variable

XAYNET_API__BIND_ADDRESS=127.0.0.1:8081
tls_certificate: Option<PathBuf>
This is supported on crate feature tls only.

The path to the server certificate to enable TLS server authentication. Leave this out to disable server authentication. If this is present, then tls_key must also be present.

Requires the tls feature to be enabled.

Examples

TOML

[api]
tls_certificate = path/to/tls/files/cert.pem

Environment variable

XAYNET_API__TLS_CERTIFICATE=path/to/tls/files/certificate.pem
tls_key: Option<PathBuf>
This is supported on crate feature tls only.

The path to the server private key to enable TLS server authentication. Leave this out to disable server authentication. If this is present, then tls_certificate must also be present.

Requires the tls feature to be enabled.

Examples

TOML

[api]
tls_key = path/to/tls/files/key.rsa

Environment variable

XAYNET_API__TLS_KEY=path/to/tls/files/key.rsa

Trait Implementations

impl Clone for ApiSettings[src]

impl Debug for ApiSettings[src]

impl<'de> Deserialize<'de> for ApiSettings[src]

impl Validate for ApiSettings[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]