Implemented CursorType for i32/i64

This commit is contained in:
smihica 2021-11-12 18:11:08 +09:00
parent 396e7bc175
commit 15fb04ef52

View File

@ -31,6 +31,30 @@ impl CursorType for usize {
}
}
impl CursorType for i32 {
type Error = ParseIntError;
fn decode_cursor(s: &str) -> Result<Self, Self::Error> {
s.parse()
}
fn encode_cursor(&self) -> String {
self.to_string()
}
}
impl CursorType for i64 {
type Error = ParseIntError;
fn decode_cursor(s: &str) -> Result<Self, Self::Error> {
s.parse()
}
fn encode_cursor(&self) -> String {
self.to_string()
}
}
impl CursorType for String {
type Error = Infallible;