spacegate_plugin

Trait SgRequestExt

source
pub trait SgRequestExt {
    // Required methods
    fn with_reflect(&mut self);
    fn reflect_mut(&mut self) -> &mut Reflect;
    fn reflect(&self) -> &Reflect;
    fn extract<M>(&self) -> M
       where M: Extract;
    fn defer_call<F>(&mut self, f: F)
       where F: FnOnce(Request<SgBody>) -> Request<SgBody> + Send + 'static;
}
Expand description

Provides extension methods for Request.

Required Methods§

source

fn with_reflect(&mut self)

source

fn reflect_mut(&mut self) -> &mut Reflect

source

fn reflect(&self) -> &Reflect

source

fn extract<M>(&self) -> M
where M: Extract,

source

fn defer_call<F>(&mut self, f: F)
where F: FnOnce(Request<SgBody>) -> Request<SgBody> + Send + 'static,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

source§

impl SgRequestExt for Request<SgBody>

source§

fn reflect_mut(&mut self) -> &mut Reflect

Get a mutable reference to the reflect extension.

§Panics

Panics if the reflect extension is not found. If you are using a request created by spacegate, this should never happen.

source§

fn reflect(&self) -> &Reflect

Get a reference to the reflect extension.

§Panics

Panics if the reflect extension is not found. If you are using a request created by spacegate, this should never happen.

source§

fn with_reflect(&mut self)

Add a reflect extension to the request if it does not exist.

source§

fn extract<M>(&self) -> M
where M: Extract,

Extract a value from the request.

source§

fn defer_call<F>(&mut self, f: F)
where F: FnOnce(Request<SgBody>) -> Request<SgBody> + Send + 'static,

Implementors§