Trait rink_sandbox::Service [−][src]
pub trait Service: Sized + RefUnwindSafe + 'static { type Req: Serialize + DeserializeOwned; type Res: Serialize + DeserializeOwned; type Config: Serialize + DeserializeOwned + Clone + 'static; fn args(config: &Self::Config) -> Vec<OsString>; fn timeout(config: &Self::Config) -> Duration; fn create(config: Self::Config) -> Result<Self, IoError>; fn handle(&self, request: Self::Req) -> Self::Res; }
Expand description
In order to sandbox some logic, there needs to be an implementation of this trait for it.
Associated Types
type Req: Serialize + DeserializeOwned
[src]
type Req: Serialize + DeserializeOwned
[src]The request, sent from the parent to the child.
type Res: Serialize + DeserializeOwned
[src]
type Res: Serialize + DeserializeOwned
[src]The response, sent from the child to the parent after the request has been processed.
type Config: Serialize + DeserializeOwned + Clone + 'static
[src]
type Config: Serialize + DeserializeOwned + Clone + 'static
[src]The config is passed to the child on startup.
Required methods
When your app is passed these CLI flags, it should call
become_child
.
The amount of time that can be spent servicing queries.
Creates an instance of the service from the config.