#[non_exhaustive]pub struct Notification<R> {
pub query_id: Uuid,
pub action: Action,
pub data: R,
}
Expand description
A live query notification
Live queries return a stream of notifications. The notification contains an action
that triggered the change in the database record and data
itself.
For deletions the data is the record before it was deleted. For everything else, it’s the newly created record or updated record depending on whether
the action is create or update.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.query_id: Uuid
§action: Action
§data: R
Implementations§
Source§impl Notification<Value>
impl Notification<Value>
pub fn map_deserialize<R>(self) -> Result<Notification<R>, Db>where
R: DeserializeOwned,
Trait Implementations§
Source§impl<R: Clone> Clone for Notification<R>
impl<R: Clone> Clone for Notification<R>
Source§fn clone(&self) -> Notification<R>
fn clone(&self) -> Notification<R>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<R: Debug> Debug for Notification<R>
impl<R: Debug> Debug for Notification<R>
Source§impl<R: Hash> Hash for Notification<R>
impl<R: Hash> Hash for Notification<R>
Source§impl<R: Ord> Ord for Notification<R>
impl<R: Ord> Ord for Notification<R>
Source§fn cmp(&self, other: &Notification<R>) -> Ordering
fn cmp(&self, other: &Notification<R>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<R: PartialEq> PartialEq for Notification<R>
impl<R: PartialEq> PartialEq for Notification<R>
Source§impl<R: PartialOrd> PartialOrd for Notification<R>
impl<R: PartialOrd> PartialOrd for Notification<R>
Source§impl<R> QueryStream<Notification<R>> for ()where
R: DeserializeOwned + Unpin,
impl<R> QueryStream<Notification<R>> for ()where
R: DeserializeOwned + Unpin,
Source§fn query_stream(
self,
response: &mut QueryResponse,
) -> Result<QueryStream<Notification<R>>>
fn query_stream( self, response: &mut QueryResponse, ) -> Result<QueryStream<Notification<R>>>
Retrieves the query stream future
Source§impl<R> QueryStream<Notification<R>> for usizewhere
R: DeserializeOwned + Unpin,
impl<R> QueryStream<Notification<R>> for usizewhere
R: DeserializeOwned + Unpin,
Source§fn query_stream(
self,
response: &mut QueryResponse,
) -> Result<QueryStream<Notification<R>>>
fn query_stream( self, response: &mut QueryResponse, ) -> Result<QueryStream<Notification<R>>>
Retrieves the query stream future
impl<R: Copy> Copy for Notification<R>
impl<R: Eq> Eq for Notification<R>
impl<R> StructuralPartialEq for Notification<R>
Auto Trait Implementations§
impl<R> Freeze for Notification<R>where
R: Freeze,
impl<R> RefUnwindSafe for Notification<R>where
R: RefUnwindSafe,
impl<R> Send for Notification<R>where
R: Send,
impl<R> Sync for Notification<R>where
R: Sync,
impl<R> Unpin for Notification<R>where
R: Unpin,
impl<R> UnwindSafe for Notification<R>where
R: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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>
Converts
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>
Converts
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