pub struct WindowedQueryWatch<T: CellValue> { /* private fields */ }Expand description
A live ordered query page with authoritative pagination metadata.
Implementations§
Source§impl<T: CellValue> WindowedQueryWatch<T>
impl<T: CellValue> WindowedQueryWatch<T>
pub const fn items(&self) -> &Cell<Vec<Arc<T>>, CellImmutable>
pub const fn ready(&self) -> &Cell<bool, CellImmutable>
pub const fn total_count(&self) -> &Cell<Option<usize>, CellImmutable>
pub const fn window(&self) -> &Cell<Option<QueryWindow>, CellImmutable>
Sourcepub const fn state(&self) -> &Cell<WindowedQueryState<T>, CellImmutable>
pub const fn state(&self) -> &Cell<WindowedQueryState<T>, CellImmutable>
One coherent reactive value for rendering the page and its controls.
Sourcepub fn set_window(&self, window: Option<QueryWindow>) -> Result<(), String>
pub fn set_window(&self, window: Option<QueryWindow>) -> Result<(), String>
Move this live subscription to another window without resubscribing.
§Errors
Returns an error if the control message cannot be encoded.
Sourcepub fn set_cursor_window(&self, window: QueryCursorWindow) -> Result<(), String>
pub fn set_cursor_window(&self, window: QueryCursorWindow) -> Result<(), String>
Move this live subscription to an exclusive ID-keyset page.
§Errors
Returns an error for an invalid cursor or when encoding fails.
Sourcepub fn next_cursor_page(&self, limit: usize) -> Result<bool, String>where
T: WithId,
pub fn next_cursor_page(&self, limit: usize) -> Result<bool, String>where
T: WithId,
Request the keyset page immediately after the last visible item.
§Errors
Returns an error when encoding the control message fails.
Sourcepub fn previous_cursor_page(&self, limit: usize) -> Result<bool, String>where
T: WithId,
pub fn previous_cursor_page(&self, limit: usize) -> Result<bool, String>where
T: WithId,
Request the keyset page immediately before the first visible item.
§Errors
Returns an error when encoding the control message fails.
Sourcepub fn set_page(&self, offset: usize, limit: usize) -> Result<(), String>
pub fn set_page(&self, offset: usize, limit: usize) -> Result<(), String>
Select a page using an absolute offset and limit.
§Errors
Returns an error if the control message cannot be encoded.
Sourcepub fn next_page(&self) -> Result<bool, String>
pub fn next_page(&self) -> Result<bool, String>
Request the next page when the acknowledged window has more rows.
Returns Ok(false) when pagination metadata is not ready or the watch
is already on its final page.
§Errors
Returns an error if the control message cannot be encoded.
Sourcepub fn previous_page(&self) -> Result<bool, String>
pub fn previous_page(&self) -> Result<bool, String>
Request the previous page when the acknowledged window is not first.
§Errors
Returns an error if the control message cannot be encoded.
Sourcepub fn first_page(&self) -> Result<bool, String>
pub fn first_page(&self) -> Result<bool, String>
Request the first page when the acknowledged window is not first.
§Errors
Returns an error if the control message cannot be encoded.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for WindowedQueryWatch<T>
impl<T> !UnwindSafe for WindowedQueryWatch<T>
impl<T> Freeze for WindowedQueryWatch<T>
impl<T> Send for WindowedQueryWatch<T>
impl<T> Sync for WindowedQueryWatch<T>
impl<T> Unpin for WindowedQueryWatch<T>
impl<T> UnsafeUnpin for WindowedQueryWatch<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more