oa_gateway::config::owp

Struct OwpSection

Source
pub(crate) struct OwpSection {
Show 20 fields pub(crate) enabled: bool, pub(crate) id: String, pub(crate) bind: String, pub(crate) server_id: String, pub(crate) system_label: String, pub(crate) schema: String, pub(crate) unwrap_ma_payloads: bool, pub(crate) xml_baseline: bool, pub(crate) tls_cert: String, pub(crate) tls_key: String, pub(crate) tls_client_ca: String, pub(crate) max_frame_size: usize, pub(crate) max_connections: usize, pub(crate) max_subscriptions: usize, pub(crate) init_timeout_secs: u64, pub(crate) idle_timeout_secs: u64, pub(crate) allowed_origins: Vec<String>, pub(crate) reconnect: bool, pub(crate) reconnect_delay_secs: u64, pub(crate) on_panic: String,
}
Expand description

OWP adapter settings.

Off when the section is omitted. A present [owp] table turns it on unless enabled = false. bind stays a string so localhost:9000 can be resolved at startup the same way as 127.0.0.1:9000.

Fields§

§enabled: bool

Whether to spawn the adapter. true when the section is present.

§id: String

Engine adapter id. Defaults to "owp".

§bind: String

Listen address, host:port. Defaults to 127.0.0.1:9000.

§server_id: String

Server identity sent on INIT. Defaults to "oa-gateway-0".

§system_label: String

Human-readable label sent on INIT.

§schema: String

Protocol schema string a client INIT must match exactly.

This is not super::UciSection::schema. Empty means no check. Defaults to "002.5.0".

§unwrap_ma_payloads: bool

Peel A-GRA Rx/Tx hex wrappers on PUB and fan out wrapper plus inner. Defaults to true.

§xml_baseline: bool

Convert OMS JSON ↔ UCI XML at the socket so the engine and ASB see XML. Requires [uci].schema. Defaults to false.

§tls_cert: String

PEM certificate chain served to clients, leaf certificate first. Empty (the default) leaves the listener plaintext. Requires tls_key; setting one without the other is a startup error.

§tls_key: String

PEM private key for tls_cert, in PKCS#8, PKCS#1, or SEC1 form. Empty (the default) leaves the listener plaintext. Requires tls_cert.

§tls_client_ca: String

PEM bundle of certificate authorities a client certificate must chain to. Empty (the default) accepts a client with or without one. Requires tls_cert/tls_key; once set, a client that cannot present a certificate from this bundle is refused at the handshake.

§max_frame_size: usize

Largest frame accepted from a client, in bytes. Oversized frames end that session. Defaults to the adapter crate’s limit.

§max_connections: usize

Connections served at once. Further ones are closed on accept.

§max_subscriptions: usize

Subscriptions one connection may hold. A SUB past the limit is refused and the session continues.

§init_timeout_secs: u64

Seconds from an accepted connection to a successful INIT before it is closed. 0 disables. Defaults to 30.

§idle_timeout_secs: u64

Seconds with no frame in either direction on an active session before it is closed. 0 disables. Defaults to 600.

§allowed_origins: Vec<String>

Exact Origin header values accepted at the WebSocket handshake. Empty (the default) accepts any origin; a non-empty list refuses a handshake whose Origin is not one of these with 403.

§reconnect: bool

Rebind and accept again after the accept loop ends or panics. Defaults to false: an existing deployment sees no behavior change until it opts in.

§reconnect_delay_secs: u64

Seconds to wait between rebind attempts. Defaults to 1.

§on_panic: String

abort or reconnect when the accept loop panics. Defaults to "abort".

Implementations§

Source§

impl OwpSection

Source

pub(crate) fn on_panic_mode(&self) -> Result<OnPanic, String>

Parses Self::on_panic into [oa_gateway_adapter::OnPanic].

§Errors

Returns an error if the string is not abort or reconnect.

Trait Implementations§

Source§

impl Debug for OwpSection

Source§

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

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

impl Default for OwpSection

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for OwpSection

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

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

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,