Struct pemmican::Pemmican [−][src]
pub struct Pemmican<S, E> { pub shared: Arc<Shared<S>>, pub plugins: Vec<Arc<Box<Plugin<S, E>>>>, // some fields omitted }
A Pemmican server instance.
Fields
plugins: Vec<Arc<Box<Plugin<S, E>>>>
Methods
impl<S, E> Pemmican<S, E> where
S: 'static,
E: Send + Sync + StdError + 'static,
[src]
impl<S, E> Pemmican<S, E> where
S: 'static,
E: Send + Sync + StdError + 'static,
pub fn new(
config: Config,
plugins: Vec<Arc<Box<Plugin<S, E>>>>,
initial_state: S
) -> Pemmican<S, E>
[src]
pub fn new(
config: Config,
plugins: Vec<Arc<Box<Plugin<S, E>>>>,
initial_state: S
) -> Pemmican<S, E>
Create a new pemmican server instance
pub fn run<F>(self, addr: &str, shutdown_signal: F) -> Result<(), Error> where
F: Future<Item = (), Error = ()>,
[src]
pub fn run<F>(self, addr: &str, shutdown_signal: F) -> Result<(), Error> where
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: 'static,
E: Send + Sync + StdError + 'static,
[src]
impl<S, E> Service for Pemmican<S, E> where
S: '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]
fn call(&self, req: Request) -> Self::Future
Process the request and return the response asynchronously.