[−][src]Trait uni_components::service::Service
Represents server side handler.
It's a good idea to use define_service! instead of trying to implement the trait by yourself.
Associated Types
type In: 'static + DeserializeOwned + Serialize
[src]
Input parameter type (There are special limitations for Kind::Get requests
type Out: 'static + DeserializeOwned + Serialize
[src]
Output parameter type
Required methods
pub fn path(&self) -> &str
[src]
Path to the handler at service
pub fn kind(&self) -> Kind
[src]
The kind of requests service will process
pub fn from_response(
&self
) -> fn(response: Response) -> Result<Self::Out, Response>
[src]
&self
) -> fn(response: Response) -> Result<Self::Out, Response>
Converter from HTTP response to Service's output type
Provided methods
pub fn exec(
&self,
parameter: &Self::In,
slot: &dyn Slot<Result<Self::Out, Response>>
) -> Result<(), CallError>
[src]
&self,
parameter: &Self::In,
slot: &dyn Slot<Result<Self::Out, Response>>
) -> Result<(), CallError>
Executes the service. Default implementation call related to the path
at
server side.
parameter - input parameter
slot - will receive result of the server call