[−][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
Input parameter type (There are special limitations for Kind::Get requests
type Out: 'static + DeserializeOwned + Serialize
Output parameter type
Required methods
fn path(&self) -> &str
Path to the handler at service
fn kind(&self) -> Kind
The kind of requests service will process
fn from_response(&self) -> fn(response: Response) -> Result<Self::Out, Response>
Converter from HTTP response to Service's output type
Provided methods
fn exec(
&self,
parameter: &Self::In,
slot: &dyn Slot<Result<Self::Out, Response>>
) -> Result<(), CallError>
&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