IntoCursor

Trait IntoCursor 

Source
pub trait IntoCursor {
    // Required method
    fn into_cursor(self) -> Option<Cursor>;
}
Expand description

Trait for types that can be converted into a cursor.

This provides flexible DX for cursor pagination methods:

  • Cursor - zero-cost move when you own the cursor
  • &str - automatically decodes, returns None if invalid
  • Option<&str> - perfect for req.query("after") results

§Example

// All of these work:
.after_cursor(cursor)            // Cursor (zero-cost move)
.after_cursor(cursor.clone())    // explicit clone if you need to keep it
.after_cursor("eyJpZCI6MTAwfQ") // &str (base64 encoded)
.after_cursor(req.query("after")) // Option<&str>

Required Methods§

Source

fn into_cursor(self) -> Option<Cursor>

Convert into an optional cursor. Returns None if the input is invalid or missing.

Implementations on Foreign Types§

Source§

impl IntoCursor for &str

Source§

impl IntoCursor for &String

Source§

impl IntoCursor for String

Source§

impl<T: IntoCursor> IntoCursor for Option<T>

Implementors§