pub struct CursorRequest {
pub after: Option<String>,
pub per_page: i64,
}Expand description
Cursor pagination request extracted from the query string.
Parsed from ?after=<cursor>&per_page=N. Implements
FromRequestParts so it can be used directly as a handler argument.
Fields§
§after: Option<String>Cursor value from a previous CursorPage::next_cursor. None starts from the beginning.
per_page: i64Items per page. Clamped by PaginationConfig.
Implementations§
Source§impl CursorRequest
impl CursorRequest
Sourcepub fn clamp(&mut self, config: &PaginationConfig)
pub fn clamp(&mut self, config: &PaginationConfig)
Clamp values using config.
Trait Implementations§
Source§impl Clone for CursorRequest
impl Clone for CursorRequest
Source§fn clone(&self) -> CursorRequest
fn clone(&self) -> CursorRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CursorRequest
impl Debug for CursorRequest
Source§impl<'de> Deserialize<'de> for CursorRequest
impl<'de> Deserialize<'de> for CursorRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<S: Send + Sync> FromRequestParts<S> for CursorRequest
impl<S: Send + Sync> FromRequestParts<S> for CursorRequest
Auto Trait Implementations§
impl Freeze for CursorRequest
impl RefUnwindSafe for CursorRequest
impl Send for CursorRequest
impl Sync for CursorRequest
impl Unpin for CursorRequest
impl UnsafeUnpin for CursorRequest
impl UnwindSafe for CursorRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.