pub struct Page<T> { /* private fields */ }Expand description
One page of lookup results.
A capability path can hold more registrations than a single DHT read can
return, so lookups page. next is Some only when the backend knows more
results remain; an empty page with next: None means the query is
exhausted.
Implementations§
Source§impl<T> Page<T>
impl<T> Page<T>
Sourcepub const fn partial(items: Vec<T>, next: Cursor) -> Self
pub const fn partial(items: Vec<T>, next: Cursor) -> Self
Creates a page with more results available from next.
Sourcepub const fn next_cursor(&self) -> Option<Cursor>
pub const fn next_cursor(&self) -> Option<Cursor>
Returns the cursor for the next page, if more results remain.
Sourcepub fn into_items(self) -> Vec<T>
pub fn into_items(self) -> Vec<T>
Consumes the page and returns its results.
Trait Implementations§
impl<T: Eq> Eq for Page<T>
Source§impl<T> IntoIterator for Page<T>
impl<T> IntoIterator for Page<T>
impl<T: PartialEq> StructuralPartialEq for Page<T>
Auto Trait Implementations§
impl<T> Freeze for Page<T>
impl<T> RefUnwindSafe for Page<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for Page<T>
impl<T> Sync for Page<T>
impl<T> Unpin for Page<T>
impl<T> UnsafeUnpin for Page<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for Page<T>where
Vec<T>: UnwindSafe,
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