[−][src]Struct webthing::server::WebThingServer
Server to represent a Web Thing over HTTP.
Methods
impl WebThingServer
[src]
pub fn new(
things: ThingsType,
port: Option<u16>,
hostname: Option<String>,
ssl_options: Option<(String, String)>,
action_generator: Box<dyn ActionGenerator>,
router: Option<Box<dyn Fn(App<AppState>) -> App<AppState> + Send + Sync>>,
base_path: Option<String>
) -> WebThingServer
[src]
things: ThingsType,
port: Option<u16>,
hostname: Option<String>,
ssl_options: Option<(String, String)>,
action_generator: Box<dyn ActionGenerator>,
router: Option<Box<dyn Fn(App<AppState>) -> App<AppState> + Send + Sync>>,
base_path: Option<String>
) -> WebThingServer
Create a new WebThingServer.
things -- list of Things managed by this server name -- name of this device -- this is only needed if the server is managing multiple things port -- port to listen on (defaults to 80) hostname -- optional host name, i.e. mything.com ssl_options -- tuple of SSL options to pass to the actix web server action_generator -- action generator struct router -- additional router to add to server base_path -- base URL to use, rather than '/'
pub fn create(&mut self) -> Addr<Server>
[src]
Start listening for incoming connections.
pub fn start(self)
[src]
Start the system and run the server. This is a blocking method call.
Auto Trait Implementations
impl !Unpin for WebThingServer
impl !Sync for WebThingServer
impl !Send for WebThingServer
impl !RefUnwindSafe for WebThingServer
impl !UnwindSafe for WebThingServer
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> GetTypeId for T where
T: Any,
[src]
T: Any,