[][src]Struct webthing::server::WebThingServer

pub struct WebThingServer { /* fields omitted */ }

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]

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

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> GetTypeId for T where
    T: Any
[src]

fn typeid(&self) -> TypeId[src]