#[non_exhaustive]pub struct RelayPageResult {
pub rows: Vec<JsonbValue>,
pub total_count: Option<u64>,
}Expand description
Result from a relay pagination query, containing rows and an optional total count.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.rows: Vec<JsonbValue>The page of JSONB rows (already trimmed to the requested page size).
total_count: Option<u64>Total count of matching rows (only populated when requested via include_total_count).
Implementations§
Source§impl RelayPageResult
impl RelayPageResult
Sourcepub const fn new(rows: Vec<JsonbValue>, total_count: Option<u64>) -> Self
pub const fn new(rows: Vec<JsonbValue>, total_count: Option<u64>) -> Self
Creates a new RelayPageResult.
Sourcepub fn rows(&self) -> &[JsonbValue]
pub fn rows(&self) -> &[JsonbValue]
Returns a reference to the page of JSONB rows.
Sourcepub fn into_rows(self) -> Vec<JsonbValue>
pub fn into_rows(self) -> Vec<JsonbValue>
Consumes the result and returns the rows.
Sourcepub const fn total_count(&self) -> Option<u64>
pub const fn total_count(&self) -> Option<u64>
Returns the total count of matching rows, if requested.
Trait Implementations§
Source§impl Clone for RelayPageResult
impl Clone for RelayPageResult
Source§fn clone(&self) -> RelayPageResult
fn clone(&self) -> RelayPageResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RelayPageResult
impl RefUnwindSafe for RelayPageResult
impl Send for RelayPageResult
impl Sync for RelayPageResult
impl Unpin for RelayPageResult
impl UnsafeUnpin for RelayPageResult
impl UnwindSafe for RelayPageResult
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