Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 27 fields pub ocpp_listen: Option<SocketAddr>, pub ocpp_tls_listen: Option<SocketAddr>, pub tls: Option<TlsSettings>, pub cso_name: Option<String>, pub max_connections: usize, pub api_listen: SocketAddr, pub database_url: String, pub database_max_connections: u32, pub node_id: String, pub versions: Vec<OcppVersion>, pub heartbeat_interval: Duration, pub call_timeout: Duration, pub ping_interval: Duration, pub max_message_size: usize, pub ws_deflate: bool, pub ws_force_client_no_context_takeover: bool, pub require_password: bool, pub authorize_unknown_tokens: bool, pub api_token: Option<String>, pub command_queue_size: usize, pub auth_concurrency: usize, pub nominal_voltage: f64, pub ev_charging_needs: bool, pub allow_bidirectional: bool, pub reservation_sweep_interval: Duration, pub default_timezone: String, pub zoneinfo_dir: PathBuf,
}

Fields§

§ocpp_listen: Option<SocketAddr>

Plain (unencrypted) listener for charging stations; none disables it. Env: OCPP_LISTEN.

§ocpp_tls_listen: Option<SocketAddr>

TLS listener for charging stations (Security Profiles 2 and 3). Env: OCPP_TLS_LISTEN.

§tls: Option<TlsSettings>

Env: OCPP_TLS_CERT/OCPP_TLS_KEY (+ optional OCPP_TLS_CERT2/OCPP_TLS_KEY2), OCPP_TLS_CLIENT_CA, OCPP_TLS_CIPHERS.

§cso_name: Option<String>

CSO name expected in the O RDN of station certificates (A00.FR.404). Env: OCPP_CSO_NAME.

§max_connections: usize

Maximum concurrent station connections per listener. Env: OCPP_MAX_CONNECTIONS.

§api_listen: SocketAddr

Listener for the internal HTTP API. Env: API_LISTEN.

§database_url: String

Env: DATABASE_URL.

§database_max_connections: u32

Env: DATABASE_MAX_CONNECTIONS.

§node_id: String

Identifies this instance in the charging_stations.connected_node column. Env: NODE_ID.

§versions: Vec<OcppVersion>

OCPP versions offered to stations. Env: OCPP_VERSIONS (e.g. 1.6,2.0.1,2.1).

§heartbeat_interval: Duration

Heartbeat interval returned in BootNotification responses. Env: HEARTBEAT_INTERVAL_SECS.

§call_timeout: Duration

Timeout for CSMS-initiated calls. Env: CALL_TIMEOUT_SECS.

§ping_interval: Duration

Server-side WebSocket ping interval when the link is idle; 0 disables. Env: PING_INTERVAL_SECS.

§max_message_size: usize

Env: MAX_MESSAGE_SIZE (bytes).

§ws_deflate: bool

RFC 7692 permessage-deflate. Env: WS_DEFLATE.

§ws_force_client_no_context_takeover: bool

Impose client_no_context_takeover to save memory. Env: WS_FORCE_CLIENT_NO_CONTEXT_TAKEOVER.

§require_password: bool

Reject stations that have no password configured (Security Profile ≥ 1 everywhere). Env: OCPP_REQUIRE_PASSWORD.

§authorize_unknown_tokens: bool

Accept id tokens that are not in the database. Env: AUTHORIZE_UNKNOWN_TOKENS.

§api_token: Option<String>

Bearer token required by the HTTP API, if set. Env: API_TOKEN.

§command_queue_size: usize

Max queued commands per station connection. Env: COMMAND_QUEUE_SIZE.

§auth_concurrency: usize

Max concurrent password verifications (argon2 is memory-hard). Env: AUTH_CONCURRENCY.

§nominal_voltage: f64

Nominal phase voltage used to convert A ↔ W in composite schedules. Env: NOMINAL_VOLTAGE.

§ev_charging_needs: bool

Answer ISO 15118 NotifyEVChargingNeeds with a TxProfile (K15–K19). Env: SMART_CHARGING_EV_NEEDS.

§allow_bidirectional: bool

Accept bidirectional energy transfer modes requested by EVs (OCPP 2.1). Env: ALLOW_BIDIRECTIONAL.

§reservation_sweep_interval: Duration

How often expired reservations are closed. Env: RESERVATION_SWEEP_SECS.

§default_timezone: String

Time zone of stations without their own (tariff conditions use local time). Env: DEFAULT_TIMEZONE.

§zoneinfo_dir: PathBuf

Directory of the IANA time zone database. Env: TZDIR.

Implementations§

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

Formats the value using the given formatter. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

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

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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

Source§

fn vzip(self) -> V

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