Struct sbd_server::Config

source ·
pub struct Config {
    pub cert_pem_file: Option<PathBuf>,
    pub priv_key_pem_file: Option<PathBuf>,
    pub bind: Vec<String>,
    pub trusted_ip_header: Option<String>,
    pub limit_clients: i32,
    pub disable_rate_limiting: bool,
    pub limit_ip_kbps: i32,
    pub limit_ip_byte_burst: i32,
    pub limit_idle_millis: i32,
}
Expand description

Configure and execute an SBD server.

Fields§

§cert_pem_file: Option<PathBuf>

TLS certificate path (pem). If specified, --priv-key-pem-file must also be specified. It is recommended to run acme service on port 80 and only bind SBD to port 443.

§priv_key_pem_file: Option<PathBuf>

TLS private key path (pem). If specified, --cert-pem-file must also be specified. It is recommended to run acme service on port 80 and only bind SBD to port 443.

§bind: Vec<String>

Bind to this interface and port. Can be specified more than once. E.g. --bind 0.0.0.0:0 E.g. --bind [::]:0 E.g. --bind 192.168.0.10:443

§trusted_ip_header: Option<String>

Use this http header to determine IP address instead of the raw TCP connection details.

§limit_clients: i32

Limit client connections.

§disable_rate_limiting: bool

If set, rate-limiting will be disabled on the server, and clients will be informed they have an 8gbps rate limit.

§limit_ip_kbps: i32

Rate limit connections to this kilobits per second. The default value of 1000 obviously limits connections to 1 mbps. If the default of 32768 connections were all sending this amount at the same time, the server would need a ~33 gbps connection. The rate limit passed to clients will be divided by the number of open connections for a given ip address.

§limit_ip_byte_burst: i32

Allow IPs to burst by this byte count. If the max message size is 16K, this value must be at least 16K. The default value provides 16 * 16K to allow for multiple connections from a single ip address sending full messages at the same time.

§limit_idle_millis: i32

How long in milliseconds connections can remain idle before being closed. Clients must send either a message or a keepalive before this time expires to keep the connection alive.

Trait Implementations§

source§

impl Args for Config

source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can update self. Read more
source§

impl CommandFactory for Config

source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
source§

impl Debug for Config

source§

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

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

impl Default for Config

source§

fn default() -> Self

Construct a new config with some defaults set.

source§

impl FromArgMatches for Config

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Parser for Config

source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error.
source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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, 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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V