[][src]Trait warpgrapher::engine::context::RequestContext

pub trait RequestContext: 'static + Clone + Debug + Send + Sync {
    pub fn new() -> Self;
}

Trait that, when implemented, marks a struct as a request context, used to pass data to custom extensions and resolvers on a per-request basis

Examples


#[derive(Clone, Debug)]
struct AppRequestContext {
    session_token: String
}

impl RequestContext for AppRequestContext {
    fn new() -> Self {
        AppRequestContext { session_token: "".to_string() }
    }
}

let ac = AppRequestContext { session_token: "".to_string() };

Required methods

pub fn new() -> Self[src]

Loading content...

Implementations on Foreign Types

impl RequestContext for ()[src]

Loading content...

Implementors

Loading content...