Struct delta_sharing_server::protocol::share::ListCursor
source · pub struct ListCursor { /* private fields */ }Expand description
Type for pagination through a collection of shared objects.
Implementations§
source§impl ListCursor
impl ListCursor
sourcepub fn new(max_results: Option<u32>, page_token: Option<String>) -> Self
pub fn new(max_results: Option<u32>, page_token: Option<String>) -> Self
Create a new ListCursor with the given max_results and page_token
sourcepub fn max_results(&self) -> Option<u32>
pub fn max_results(&self) -> Option<u32>
Retrieve the maximum amount of objects that should be fetched.
Example
use delta_sharing_server::protocol::share::ListCursor;
let cursor = ListCursor::new(Some(3), None);
assert_eq!(cursor.max_results(), Some(3));sourcepub fn page_token(&self) -> Option<&str>
pub fn page_token(&self) -> Option<&str>
Retrieve the index from where to resume fetching.
Example
use delta_sharing_server::protocol::share::ListCursor;
let cursor = ListCursor::new(None, Some(String::from("page1")));
assert_eq!(cursor.page_token(), Some("page1"));sourcepub fn has_page_token(&self) -> bool
pub fn has_page_token(&self) -> bool
Check whether or not this cursor is in the middle of fetching.
Example
use delta_sharing_server::protocol::share::ListCursor;
let cursor = ListCursor::new(None, Some(String::from("page1")));
assert!(cursor.has_page_token());
let cursor = ListCursor::new(None, None);
assert!(!cursor.has_page_token());Trait Implementations§
source§impl Clone for ListCursor
impl Clone for ListCursor
source§fn clone(&self) -> ListCursor
fn clone(&self) -> ListCursor
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ListCursor
impl Debug for ListCursor
source§impl Default for ListCursor
impl Default for ListCursor
source§fn default() -> ListCursor
fn default() -> ListCursor
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ListCursor
impl<'de> Deserialize<'de> for ListCursor
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for ListCursor
impl Hash for ListCursor
source§impl PartialEq<ListCursor> for ListCursor
impl PartialEq<ListCursor> for ListCursor
source§fn eq(&self, other: &ListCursor) -> bool
fn eq(&self, other: &ListCursor) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for ListCursor
impl Serialize for ListCursor
impl Eq for ListCursor
impl StructuralEq for ListCursor
impl StructuralPartialEq for ListCursor
Auto Trait Implementations§
impl RefUnwindSafe for ListCursor
impl Send for ListCursor
impl Sync for ListCursor
impl Unpin for ListCursor
impl UnwindSafe for ListCursor
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.