pub trait CursorType: Sized {
type Error: Display;
// Required methods
fn decode_cursor(s: &str) -> Result<Self, Self::Error>;
fn encode_cursor(&self) -> String;
}
Expand description
Cursor type
A custom scalar that serializes as a string. https://relay.dev/graphql/connections.htm#sec-Cursor
Required Associated Types§
Required Methods§
Sourcefn decode_cursor(s: &str) -> Result<Self, Self::Error>
fn decode_cursor(s: &str) -> Result<Self, Self::Error>
Decode cursor from string.
Sourcefn encode_cursor(&self) -> String
fn encode_cursor(&self) -> String
Encode cursor to string.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.