Struct dropshot::RequestContext
source · pub struct RequestContext<Context: ServerContext> {
pub server: Arc<DropshotState<Context>>,
pub path_variables: BTreeMap<String, VariableValue>,
pub body_content_type: ApiEndpointBodyContentType,
pub request_id: String,
pub log: Logger,
pub request: RequestInfo,
}
Expand description
Handle for various interfaces useful during request processing.
Fields§
§server: Arc<DropshotState<Context>>
shared server state
path_variables: BTreeMap<String, VariableValue>
HTTP request routing variables
body_content_type: ApiEndpointBodyContentType
expected request body mime type
request_id: String
unique id assigned to this request
log: Logger
logger for this specific request
request: RequestInfo
basic request information (method, URI, etc.)
Implementations§
source§impl<Context: ServerContext> RequestContext<Context>
impl<Context: ServerContext> RequestContext<Context>
sourcepub fn page_limit<ScanParams, PageSelector>(
&self,
pag_params: &PaginationParams<ScanParams, PageSelector>
) -> Result<NonZeroU32, HttpError>
pub fn page_limit<ScanParams, PageSelector>( &self, pag_params: &PaginationParams<ScanParams, PageSelector> ) -> Result<NonZeroU32, HttpError>
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.
Trait Implementations§
source§impl<Context: Debug + ServerContext> Debug for RequestContext<Context>
impl<Context: Debug + ServerContext> Debug for RequestContext<Context>
source§impl<T: 'static + ServerContext> RequestContextArgument for RequestContext<T>
impl<T: 'static + ServerContext> RequestContextArgument for RequestContext<T>
Auto Trait Implementations§
impl<Context> !RefUnwindSafe for RequestContext<Context>
impl<Context> Send for RequestContext<Context>
impl<Context> Sync for RequestContext<Context>
impl<Context> Unpin for RequestContext<Context>
impl<Context> !UnwindSafe for RequestContext<Context>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more