Struct webthing::server::WebThingServer
source · [−]pub struct WebThingServer { /* private fields */ }
Expand description
Server to represent a Web Thing over HTTP.
Implementations
sourceimpl WebThingServer
impl WebThingServer
sourcepub fn new(
things: ThingsType,
port: Option<u16>,
hostname: Option<String>,
ssl_options: Option<(String, String)>,
action_generator: Box<dyn ActionGenerator>,
base_path: Option<String>,
disable_host_validation: Option<bool>
) -> Self
pub fn new(
things: ThingsType,
port: Option<u16>,
hostname: Option<String>,
ssl_options: Option<(String, String)>,
action_generator: Box<dyn ActionGenerator>,
base_path: Option<String>,
disable_host_validation: Option<bool>
) -> Self
Create a new WebThingServer.
Arguments
things
- list of Things managed by this serverport
- port to listen on (defaults to 80)hostname
- optional host name, i.e. mything.comssl_options
- tuple of SSL options to pass to the actix web serveraction_generator
- action generator structbase_path
- base URL to use, rather than ‘/’disable_host_validation
- whether or not to disable host validation – note that this can lead to DNS rebinding attacks.None
means to use the default, which keeps it enabled.
sourcepub fn make_config(&mut self) -> impl Fn(&mut ServiceConfig) + Clone + 'static
pub fn make_config(&mut self) -> impl Fn(&mut ServiceConfig) + Clone + 'static
Return the base actix configuration for the server useful for testing.
Auto Trait Implementations
impl !RefUnwindSafe for WebThingServer
impl Send for WebThingServer
impl Sync for WebThingServer
impl Unpin for WebThingServer
impl !UnwindSafe for WebThingServer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more