pub struct CursorPage<T> {
pub object: String,
pub data: Vec<T>,
pub first_id: Option<String>,
pub last_id: Option<String>,
pub has_more: bool,
pub extra: BTreeMap<String, Value>,
/* private fields */
}Expand description
表示基于游标的页面对象。
Fields§
§object: String对象类型。
data: Vec<T>当前页数据。
first_id: Option<String>当前页首个对象 ID。
last_id: Option<String>当前页最后一个对象 ID。
has_more: bool是否还有下一页。
extra: BTreeMap<String, Value>额外字段。
Implementations§
Source§impl<T> CursorPage<T>
impl<T> CursorPage<T>
Sourcepub fn with_next_request(self, next: Option<PageRequestSpec>) -> Self
pub fn with_next_request(self, next: Option<PageRequestSpec>) -> Self
绑定下一页请求元数据。
Sourcepub fn has_next_page(&self) -> bool
pub fn has_next_page(&self) -> bool
判断是否存在下一页。
Sourcepub fn into_stream(self) -> PageStream<T>
pub fn into_stream(self) -> PageStream<T>
把分页对象展开成异步流。
Trait Implementations§
Source§impl<T: Clone> Clone for CursorPage<T>
impl<T: Clone> Clone for CursorPage<T>
Source§fn clone(&self) -> CursorPage<T>
fn clone(&self) -> CursorPage<T>
Returns a duplicate 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<T: Debug> Debug for CursorPage<T>
impl<T: Debug> Debug for CursorPage<T>
Source§impl<T> Default for CursorPage<T>
impl<T> Default for CursorPage<T>
Source§impl<'de, T> Deserialize<'de> for CursorPage<T>where
T: Deserialize<'de> + Default,
impl<'de, T> Deserialize<'de> for CursorPage<T>where
T: Deserialize<'de> + Default,
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<T> From<ListEnvelope<T>> for CursorPage<T>
impl<T> From<ListEnvelope<T>> for CursorPage<T>
Source§fn from(value: ListEnvelope<T>) -> Self
fn from(value: ListEnvelope<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for CursorPage<T>
impl<T> !RefUnwindSafe for CursorPage<T>
impl<T> Send for CursorPage<T>where
T: Send,
impl<T> Sync for CursorPage<T>where
T: Sync,
impl<T> Unpin for CursorPage<T>where
T: Unpin,
impl<T> UnsafeUnpin for CursorPage<T>
impl<T> !UnwindSafe for CursorPage<T>
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