[−][src]Struct new_home_core::http::client_request_handler::ClientRequestHandler
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]
&self,
client_name: String,
method_name: String,
arguments: Value
) -> Response
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
impl RequestHandler for ClientRequestHandler
[src]
fn handle_request(&self, request: &Request) -> Response
[src]
impl Send for ClientRequestHandler
[src]
impl Sync for ClientRequestHandler
[src]
Auto Trait Implementations
impl RefUnwindSafe for ClientRequestHandler
impl Unpin for ClientRequestHandler
impl UnwindSafe for ClientRequestHandler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> 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>,