[][src]Struct dropshot::RequestContext

pub struct RequestContext {
    pub server: Arc<DropshotState>,
    pub request: Arc<Mutex<Request<Body>>>,
    pub path_variables: BTreeMap<String, String>,
    pub request_id: String,
    pub log: Logger,
}

Handle for various interfaces useful during request processing. TODO-cleanup What's the right way to package up "request"? The only time we need it to be mutable is when we're reading the body (e.g., as part of the JSON extractor). In order to support that, we wrap it in something that supports interior mutability. It also needs to be thread-safe, since we're using async/await. That brings us to Arc<Mutex<...>>, but it seems like overkill since it will only really be used by one thread at a time (at all, let alone mutably) and there will never be contention on the Mutex.

Fields

server: Arc<DropshotState>

shared server state

request: Arc<Mutex<Request<Body>>>

HTTP request details

path_variables: BTreeMap<String, String>

HTTP request routing variables

request_id: String

unique id assigned to this request

log: Logger

logger for this specific request

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,