Skip to main content

Env

Struct Env 

Source
pub struct Env {
Show 19 fields pub data_dir: PathBuf, pub config_dir: PathBuf, pub log_level: String, pub bind_ipv4: bool, pub bind_ipv6: bool, pub sec_max_header_bytes: u32, pub sec_max_headers_count: u32, pub sec_header_timeout_secs: u32, pub sec_max_conn_per_ip: u32, pub sec_max_total_conns: u32, pub bind_max_attempts: u32, pub bind_backoff_initial_ms: u32, pub bind_backoff_max_ms: u32, pub force_cancel_grace_secs: u32, pub drain_timeout_secs: u32, pub boot_health_timeout_secs: u32, pub mgmt_unix: PathBuf, pub mgmt_http_bind: Option<SocketAddr>, pub mgmt_http_token: Option<String>,
}
Expand description

Typed snapshot of every VANE_* deployment constant the daemon reads at startup. Defaults match spec/architecture/09-config.md § Three-layer configuration.

Fields§

§data_dir: PathBuf

VANE_DATA_DIR — daemon working data root (default /var/lib/vaned).

§config_dir: PathBuf

VANE_CONFIG_DIR — config-tree root (default /etc/vaned).

§log_level: String

VANE_LOG_LEVEL — passed through to the tracing subscriber verbatim (default "info").

§bind_ipv4: bool

VANE_BIND_IPV4 — listen on 0.0.0.0 for :N listen specs (default true).

§bind_ipv6: bool

VANE_BIND_IPV6 — listen on [::] for :N listen specs (default true).

§sec_max_header_bytes: u32

VANE_SEC_MAX_HEADER_BYTES — request-header size cap (default 65536).

§sec_max_headers_count: u32

VANE_SEC_MAX_HEADERS_COUNT — request-header count cap (default 100).

§sec_header_timeout_secs: u32

VANE_SEC_HEADER_TIMEOUT — header-completion timeout, seconds (default 30).

§sec_max_conn_per_ip: u32

VANE_SEC_MAX_CONN_PER_IP — per-IP concurrent-connection cap (default 100).

§sec_max_total_conns: u32

VANE_SEC_MAX_TOTAL_CONNS — daemon-wide concurrent-connection cap (default 65536).

§bind_max_attempts: u32

VANE_BIND_MAX_ATTEMPTS — bind-retry count per listener address (default 10).

§bind_backoff_initial_ms: u32

VANE_BIND_BACKOFF_INITIAL_MS — initial retry backoff in milliseconds (default 100).

§bind_backoff_max_ms: u32

VANE_BIND_BACKOFF_MAX_MS — retry backoff cap in milliseconds (default 5000).

§force_cancel_grace_secs: u32

VANE_FORCE_CANCEL_GRACE_SECS — secondary grace window after force_cancel fires, seconds (default 5). Applies to both SIGTERM drain and removed-listener reconcile.

§drain_timeout_secs: u32

VANE_DRAIN_TIMEOUT_SECS — in-flight connection drain budget for reload and SIGTERM, seconds (default 30).

§boot_health_timeout_secs: u32

VANE_BOOT_HEALTH_TIMEOUT_SECS — budget for all listeners to flip bind_ready, seconds (default 60). Partial bind (some bound, some failed) stays a warn.

§mgmt_unix: PathBuf

VANE_MGMT_UNIX — management Unix socket path (default /var/run/vaned.sock).

§mgmt_http_bind: Option<SocketAddr>

VANE_MGMT_HTTP_BIND — optional HTTP management endpoint (None when unset or empty string; otherwise must parse as SocketAddr).

§mgmt_http_token: Option<String>

VANE_MGMT_HTTP_TOKEN — bearer token for mgmt_http_bind (None when unset or empty string).

Implementations§

Source§

impl Env

Source

pub fn from_process_env() -> Result<Self, Error>

Read from the actual process environment.

§Errors

Returns Error::compile when any VANE_* value fails its type-specific parse (bool, u32, SocketAddr).

Source

pub fn from_reader<R: EnvReader>(r: &R) -> Result<Self, Error>

Read from any EnvReader. Primary entry point for unit tests.

§Errors

As Self::from_process_env.

Trait Implementations§

Source§

impl Clone for Env

Source§

fn clone(&self) -> Env

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 Env

Source§

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

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

impl PartialEq for Env

Source§

fn eq(&self, other: &Env) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Env

Source§

impl StructuralPartialEq for Env

Auto Trait Implementations§

§

impl Freeze for Env

§

impl RefUnwindSafe for Env

§

impl Send for Env

§

impl Sync for Env

§

impl Unpin for Env

§

impl UnsafeUnpin for Env

§

impl UnwindSafe for Env

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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