[][src]Struct roa_core::Context

pub struct Context<M: Model> {
    pub app: App<M>,
    // some fields omitted
}

Fields

app: App<M>

Methods

impl<M: Model> Context<M>[src]

pub fn new(request: Request, app: App<M>, stream: AddrStream) -> Self[src]

pub async fn req<'a>(&'a self) -> RwLockReadGuard<'a, Request>[src]

pub async fn resp<'a>(&'a self) -> RwLockReadGuard<'a, Response>[src]

pub async fn state<'a>(&'a self) -> RwLockReadGuard<'a, M::State>[src]

pub async fn storage<'a>(
    &'a self
) -> RwLockReadGuard<'a, HashMap<TypeId, Bucket>>
[src]

pub async fn req_mut<'a>(&'a self) -> RwLockWriteGuard<'a, Request>[src]

pub async fn resp_mut<'a>(&'a self) -> RwLockWriteGuard<'a, Response>[src]

pub async fn state_mut<'a>(&'a self) -> RwLockWriteGuard<'a, M::State>[src]

pub async fn storage_mut<'a>(
    &'a self
) -> RwLockWriteGuard<'a, HashMap<TypeId, Bucket>>
[src]

pub async fn uri<'_>(&'_ self) -> Uri[src]

pub async fn method<'_>(&'_ self) -> Method[src]

pub async fn header<'_, '_>(
    &'_ self,
    name: &'_ HeaderName
) -> Option<Result<String, ToStrError>>
[src]

pub async fn header_value<'_, '_>(
    &'_ self,
    name: &'_ HeaderName
) -> Option<HeaderValue>
[src]

pub async fn status<'_>(&'_ self) -> StatusCode[src]

pub async fn version<'_>(&'_ self) -> Version[src]

pub async fn store<'a, '_, T: 'static>(
    &'_ self,
    name: &'a str,
    value: String
) -> Option<Variable<'a>>
[src]

pub async fn load<'a, '_, T: 'static>(
    &'_ self,
    name: &'a str
) -> Option<Variable<'a>>
[src]

pub fn remote_addr(&self) -> SocketAddr[src]

pub fn raw_stream(&self) -> &TcpStream[src]

Trait Implementations

impl<M: Model> Clone for Context<M>[src]

Auto Trait Implementations

impl<M> !RefUnwindSafe for Context<M>

impl<M> Send for Context<M> where
    <M as Model>::State: Send + Sync

impl<M> Sync for Context<M> where
    <M as Model>::State: Send + Sync

impl<M> Unpin for Context<M>

impl<M> !UnwindSafe for Context<M>

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.