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.

Provides flexible DX for cursor pagination methods.

§Example

// Cursor directly
let cursor = Cursor::new().int("id", 100);
assert!(cursor.into_cursor().is_some());

// Base64 encoded string
let encoded = Cursor::new().int("id", 42).encode();
let decoded: Option<Cursor> = encoded.as_str().into_cursor();
assert!(decoded.is_some());

// Option<&str> - None returns None
let none: Option<&str> = None;
assert!(none.into_cursor().is_none());

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§