pub struct ArrayView { /* private fields */ }Expand description
A materialized view of a pipeline’s output (array-view.ts).
Listeners are notified on flush, which the engine
calls when a transaction commits.
Implementations§
Source§impl ArrayView
impl ArrayView
Sourcepub fn new(
input: Rc<dyn Input>,
format: Format,
error: Option<ErroredQuery>,
complete: bool,
) -> Rc<Self>
pub fn new( input: Rc<dyn Input>, format: Format, error: Option<ErroredQuery>, complete: bool, ) -> Rc<Self>
Hydrates from input, starting as failed when error is set.
complete marks the result complete from the start.
pub fn format(&self) -> &Format
Sourcepub fn schema(&self) -> &SourceSchema
pub fn schema(&self) -> &SourceSchema
The schema of the rows.
pub fn result_type(&self) -> ResultType
Sourcepub fn error(&self) -> Option<ErroredQuery>
pub fn error(&self) -> Option<ErroredQuery>
Why the query failed, when the result type is Error.
pub fn set_on_destroy(&self, f: impl Fn() + 'static)
Sourcepub fn add_listener(
&self,
listener: impl Fn(&ViewValue, ResultType) + 'static,
) -> Box<dyn Fn()>
pub fn add_listener( &self, listener: impl Fn(&ViewValue, ResultType) + 'static, ) -> Box<dyn Fn()>
Adds a listener, calls it with the current data, and returns a function that removes it.
pub fn destroy(&self)
Sourcepub fn hold_data(&self)
pub fn hold_data(&self)
Keeps exposing the current snapshot until release_data or the next
flush.
Sourcepub fn listener_result_type(&self) -> (ResultType, Option<ErroredQuery>)
pub fn listener_result_type(&self) -> (ResultType, Option<ErroredQuery>)
The result type and error listeners are told about now.
pub fn release_data(&self)
pub fn set_result_type(&self, ty: ResultType, error: Option<ErroredQuery>)
Sourcepub fn mark_cached(&self)
pub fn mark_cached(&self)
The server-confirmed result of an earlier sync is in the store.
pub fn unmark_cached(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ArrayView
impl !RefUnwindSafe for ArrayView
impl !Send for ArrayView
impl !Sync for ArrayView
impl !UnwindSafe for ArrayView
impl Forget for ArrayView
impl Move for ArrayView
impl Unpin for ArrayView
impl UnsafeUnpin for ArrayView
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