Trait highnoon::state::State[][src]

pub trait State: Send + Sync + 'static {
    type Context: Send + Sync + 'static;
    fn new_context(&self) -> Self::Context;
}

State must be implemented for any type being used as the App's state

State is shared by all requests, and must be safe to be shared between threads (Send + Sync + 'static)

The state also creates the Context objects used to store request local data. Before processing a request a new context is created

Associated Types

type Context: Send + Sync + 'static[src]

Type of the request local context

Loading content...

Required methods

fn new_context(&self) -> Self::Context[src]

Instantiate the State object, creating a new one to be used for a single request

Loading content...

Implementations on Foreign Types

impl State for ()[src]

implement state for all types already meeting the constraints

type Context = ()

Loading content...

Implementors

Loading content...