[][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.

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

Implementations

impl RequestContext[src]

pub fn page_limit<ScanParams, PageSelector>(
    &self,
    pag_params: &PaginationParams<ScanParams, PageSelector>
) -> Result<NonZeroUsize, HttpError> where
    ScanParams: DeserializeOwned,
    PageSelector: DeserializeOwned + Serialize
[src]

Returns the appropriate count of items to return for a paginated request

This first looks at any client-requested limit and clamps it based on the server-configured maximum page size. If the client did not request any particular limit, this function returns the server-configured default page size.

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>,