pub struct MaterializedView(/* private fields */);Expand description
A view of a query that stays current as data changes (TypedView).
Implementations§
Source§impl MaterializedView
impl MaterializedView
Sourcepub fn result_type(&self) -> ResultType
pub fn result_type(&self) -> ResultType
Whether the server has confirmed the rows on this connection
(Complete) or an earlier one (Cached), or not yet (Unknown), or
the query failed (Error).
Sourcepub fn error(&self) -> Option<ErroredQuery>
pub fn error(&self) -> Option<ErroredQuery>
Why the query failed, when it did.
Sourcepub fn is_destroyed(&self) -> bool
pub fn is_destroyed(&self) -> bool
Whether destroy was called.
Sourcepub fn primary_key(&self) -> Vec<String>
pub fn primary_key(&self) -> Vec<String>
The primary key columns of the rows.
Sourcepub fn add_listener(
&self,
listener: impl Fn(&ViewValue, ResultType, Option<&ErroredQuery>) + 'static,
) -> Box<dyn Fn()>
pub fn add_listener( &self, listener: impl Fn(&ViewValue, ResultType, Option<&ErroredQuery>) + 'static, ) -> Box<dyn Fn()>
Calls listener now and whenever the data or result type change.
Returns the function that removes it.
Sourcepub fn destroy(&self)
pub fn destroy(&self)
Stops updating the view and releases its query, which the server keeps syncing for the query’s TTL.
Sourcepub fn update_ttl(&self, ttl: &Ttl)
pub fn update_ttl(&self, ttl: &Ttl)
Raises the query’s TTL; a lower one is ignored.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MaterializedView
impl !Send for MaterializedView
impl !Sync for MaterializedView
impl !UnwindSafe for MaterializedView
impl Forget for MaterializedView
impl Freeze for MaterializedView
impl Move for MaterializedView
impl Unpin for MaterializedView
impl UnsafeUnpin for MaterializedView
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