pub struct ServerConfig {
pub port: u16,
pub bind_address: String,
pub validate_paths: bool,
pub serve_control_panel: bool,
}Expand description
Configuration for the WebSocket server.
Fields§
§port: u16Port to listen on.
bind_address: StringAddress to bind to. Defaults to loopback: the protocol is
unauthenticated, so binding all interfaces is an explicit opt-in via
ServerConfig::bind_address.
validate_paths: boolWhether to validate update paths against registered input slots.
serve_control_panel: boolWhether to serve the built-in control panel on plain HTTP requests.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn bind_address(self, addr: impl Into<String>) -> Self
pub fn bind_address(self, addr: impl Into<String>) -> Self
Set the bind address.
Sourcepub fn validate_paths(self, validate: bool) -> Self
pub fn validate_paths(self, validate: bool) -> Self
Set whether to validate update paths.
Sourcepub fn serve_control_panel(self, enable: bool) -> Self
pub fn serve_control_panel(self, enable: bool) -> Self
Enable or disable the built-in control panel served on plain HTTP requests.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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