Skip to main content

ArrayView

Struct ArrayView 

Source
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

Source

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.

Source

pub fn format(&self) -> &Format

Source

pub fn schema(&self) -> &SourceSchema

The schema of the rows.

Source

pub fn data(&self) -> ViewValue

The current rows.

Source

pub fn result_type(&self) -> ResultType

Source

pub fn error(&self) -> Option<ErroredQuery>

Why the query failed, when the result type is Error.

Source

pub fn set_on_destroy(&self, f: impl Fn() + 'static)

Source

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.

Source

pub fn destroy(&self)

Source

pub fn hold_data(&self)

Keeps exposing the current snapshot until release_data or the next flush.

Source

pub fn listener_result_type(&self) -> (ResultType, Option<ErroredQuery>)

The result type and error listeners are told about now.

Source

pub fn release_data(&self)

Source

pub fn flush(&self)

Notifies listeners if the view changed since the last flush.

Source

pub fn set_result_type(&self, ty: ResultType, error: Option<ErroredQuery>)

Source

pub fn mark_cached(&self)

The server-confirmed result of an earlier sync is in the store.

Source

pub fn unmark_cached(&self)

Trait Implementations§

Source§

impl Output for ArrayView

Source§

fn push(&self, change: Change, _pusher: &dyn InputBase)

Source§

fn reconcile(&self, _pusher: &dyn InputBase)

Phase two. Sinks can ignore it; operators must forward it.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.