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

The request, sent from the parent to the child.

The response, sent from the child to the parent after the request has been processed.

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.

Responds to one request, returning a result.

Implementors