pub struct HeaderCursorPolicy<'a> { /* private fields */ }Expand description
Source-bound header names and page size for opaque cursor pagination.
Implementations§
Source§impl<'policy> HeaderCursorPolicy<'policy>
impl<'policy> HeaderCursorPolicy<'policy>
Sourcepub fn bind<'request>(
self,
prepared: PreparedRequest<'request>,
) -> Result<HeaderCursorSession<'request, 'policy>, PaginationError>
pub fn bind<'request>( self, prepared: PreparedRequest<'request>, ) -> Result<HeaderCursorSession<'request, 'policy>, PaginationError>
Binds pagination to one complete prepared request before any dispatch.
Source§impl<'a> HeaderCursorPolicy<'a>
impl<'a> HeaderCursorPolicy<'a>
Sourcepub fn new(
operation: OperationId,
cursor_request: &'a str,
size_request: &'a str,
next_response: &'a str,
page_size: u64,
) -> Result<Self, PaginationError>
pub fn new( operation: OperationId, cursor_request: &'a str, size_request: &'a str, next_response: &'a str, page_size: u64, ) -> Result<Self, PaginationError>
Creates a policy with three distinct HTTP header names and a nonzero size.
Sourcepub const fn operation_id(self) -> OperationId
pub const fn operation_id(self) -> OperationId
Returns the provider operation that owns every decoded cursor.
Sourcepub const fn cursor_request(self) -> HeaderName<'a>
pub const fn cursor_request(self) -> HeaderName<'a>
Returns the request cursor header name.
Sourcepub const fn size_request(self) -> HeaderName<'a>
pub const fn size_request(self) -> HeaderName<'a>
Returns the request page-size header name.
Sourcepub const fn next_response(self) -> HeaderName<'a>
pub const fn next_response(self) -> HeaderName<'a>
Returns the response next-cursor header name.
Trait Implementations§
Source§impl<'a> Clone for HeaderCursorPolicy<'a>
impl<'a> Clone for HeaderCursorPolicy<'a>
Source§fn clone(&self) -> HeaderCursorPolicy<'a>
fn clone(&self) -> HeaderCursorPolicy<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for HeaderCursorPolicy<'a>
Auto Trait Implementations§
impl<'a> Freeze for HeaderCursorPolicy<'a>
impl<'a> RefUnwindSafe for HeaderCursorPolicy<'a>
impl<'a> Send for HeaderCursorPolicy<'a>
impl<'a> Sync for HeaderCursorPolicy<'a>
impl<'a> Unpin for HeaderCursorPolicy<'a>
impl<'a> UnsafeUnpin for HeaderCursorPolicy<'a>
impl<'a> UnwindSafe for HeaderCursorPolicy<'a>
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