Struct pemmican::Pemmican
[−]
[src]
pub struct Pemmican<S: Send + Sync, E> { pub config: Config, pub shared: Arc<Shared<S>>, // some fields omitted }
A Pemmican server instance.
Fields
config: Config
Methods
impl<S, E> Pemmican<S, E> where
S: Send + Sync + 'static,
E: Send + Sync + StdError + 'static,
[src]
S: Send + Sync + 'static,
E: Send + Sync + StdError + 'static,
fn new(
config: Config,
router: Box<Router<S, E>>,
initial_state: S
) -> Pemmican<S, E>
[src]
config: Config,
router: Box<Router<S, E>>,
initial_state: S
) -> Pemmican<S, E>
Create a new pemmican server instance
fn plug_in(&mut self, plugin: Arc<Plugin<S, E>>)
[src]
Plug in a plugin. Currently we have not yet implemented methods to order or re-order these.
fn run<F>(self, addr: &str, shutdown_signal: F) -> Result<(), Error> where
F: Future<Item = (), Error = ()>,
[src]
F: Future<Item = (), Error = ()>,
Run the server. It will run until the shutdown_signal
future completes.
You can use futures::future::empty() to run forever.
Trait Implementations
impl<S, E> Service for Pemmican<S, E> where
S: Send + Sync + 'static,
E: Send + Sync + StdError + 'static,
[src]
S: Send + Sync + 'static,
E: Send + Sync + StdError + 'static,
type Request = Request
Requests handled by the service.
type Response = Response
Responses given by the service.
type Error = Error
Errors produced by the service.
type Future = Box<Future<Item = Self::Response, Error = Self::Error>>
The future response value.
fn call(&self, req: Request) -> Self::Future
[src]
Process the request and return the response asynchronously.