pub enum PagerState<C: AsRef<str>> {
Initial,
More(C),
}Expand description
Represents the state of a Pager or PageIterator.
Variants§
Initial
The pager should fetch the initial page.
More(C)
The pager should fetch a subsequent page using the next link/continuation token C.
Implementations§
Source§impl<C: AsRef<str>> PagerState<C>
impl<C: AsRef<str>> PagerState<C>
Sourcepub fn map<U, F>(self, f: F) -> PagerState<U>
pub fn map<U, F>(self, f: F) -> PagerState<U>
Maps a PagerState<C> to a PagerState<U> by applying a function to a next link/continuation token C (if PagerState::More) or returns PagerState::Initial (if PagerState::Initial).
Sourcepub const fn as_ref(&self) -> PagerState<&C>
pub const fn as_ref(&self) -> PagerState<&C>
Converts from &PagerState<C> to PagerState<&C>.
Sourcepub fn as_deref(&self) -> PagerState<&C::Target>
pub fn as_deref(&self) -> PagerState<&C::Target>
Converts from PagerState<C> (or &PagerState<C>) to PagerState<&C::Target>.
Leaves the original PagerState in-place, creating a new one with a reference
to the original one, additionally coercing the contents via Deref.
Trait Implementations§
Source§impl<C: AsRef<str>> Default for PagerState<C>
impl<C: AsRef<str>> Default for PagerState<C>
Source§fn default() -> PagerState<C>
fn default() -> PagerState<C>
Returns the “default value” for a type. Read more
impl<C: Eq + AsRef<str>> Eq for PagerState<C>
impl<C: AsRef<str>> StructuralPartialEq for PagerState<C>
Auto Trait Implementations§
impl<C> Freeze for PagerState<C>where
C: Freeze,
impl<C> RefUnwindSafe for PagerState<C>where
C: RefUnwindSafe,
impl<C> Send for PagerState<C>where
C: Send,
impl<C> Sync for PagerState<C>where
C: Sync,
impl<C> Unpin for PagerState<C>where
C: Unpin,
impl<C> UnwindSafe for PagerState<C>where
C: UnwindSafe,
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