pub struct ServerConfig {Show 14 fields
pub http_port: u16,
pub mqtt_port: u16,
pub database_url: String,
pub pepper: String,
pub open_registration: bool,
pub max_message_size: usize,
pub log_level: String,
pub nats_url: Option<String>,
pub redis_url: Option<String>,
pub pod_id: String,
pub rate_limit: u64,
pub rate_window: u64,
pub public_key: Option<String>,
pub private_key: Option<String>,
}Fields§
§http_port: u16HTTP port
mqtt_port: u16MQTT port
database_url: StringDatabase URL (sqlite:freshblu.db or postgresql://…)
pepper: StringBcrypt pepper for extra token security
open_registration: boolOpen registration (no auth required to register)
max_message_size: usizeMax message size in bytes
log_level: StringLog level
nats_url: Option<String>NATS URL (if set, use NatsBus; otherwise LocalBus)
redis_url: Option<String>Redis URL (if set, enable cache layer and presence)
pod_id: StringPod ID for NATS delivery routing (defaults to hostname)
rate_limit: u64Rate limit: max requests per window per device
rate_window: u64Rate limit window in seconds
public_key: Option<String>Server public key (PEM)
private_key: Option<String>Server private key (PEM)
Implementations§
Source§impl ServerConfig
impl ServerConfig
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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