[][src]Struct new_home_core::http::client_request_handler::ClientRequestHandler

pub struct ClientRequestHandler { /* fields omitted */ }

Implements request handler for client type actions Uses the ClientManager trait for communicating with the home clients

Implementations

impl ClientRequestHandler[src]

pub fn new(client_manager: Arc<RwLock<dyn ClientManager>>) -> Self[src]

pub fn get_clients(&self) -> Response[src]

Handles the GET method for the /client route. Returns an array of client names in the json key data Provides a success key as well

pub fn put_client(&self, name: String, body: ClientPutBody) -> Response[src]

Handles the PUT method for the /client/{client_name} url with the client name. Can return a message key for the output. Has to return a success key for the output.

pub fn remove_client(&self, client_name: String) -> Response[src]

Handles the DELETE method for the /client/{client_name} path. Returns an error if the client could not be removed Returns success if it was able to do so

pub fn call_client_method(
    &self,
    client_name: String,
    method_name: String,
    arguments: Value
) -> Response
[src]

Forwards the given arguments to the given client and calls the given method Will return the response from the client Has to provide a success key to the output

pub fn get_client_script(&self, request: &Request) -> Response[src]

Trait Implementations

Auto Trait Implementations

Blanket Implementations

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

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

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

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.