Enum client2::Notification
source · pub enum Notification {
ContactRequest {
sender_id: u64,
},
ContactRequestAccepted {
responder_id: u64,
},
ChannelInvitation {
channel_id: u64,
channel_name: String,
inviter_id: u64,
},
ChannelMessageMention {
message_id: u64,
sender_id: u64,
channel_id: u64,
},
}
Expand description
A notification that can be stored, associated with a given recipient.
This struct is stored in the collab database as JSON, so it shouldn’t be changed in a backward-incompatible way. For example, when renaming a variant, add a serde alias for the old name.
Most notification types have a special field which is aliased to
entity_id
. This field is stored in its own database column, and can
be used to query the notification.
Variants§
Implementations§
source§impl Notification
impl Notification
pub fn to_proto(&self) -> Notification
pub fn from_proto(notification: &Notification) -> Option<Notification>
pub fn all_variant_names() -> &'static [&'static str]
Trait Implementations§
source§impl Clone for Notification
impl Clone for Notification
source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
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 Debug for Notification
impl Debug for Notification
source§impl<'de> Deserialize<'de> for Notification
impl<'de> Deserialize<'de> for Notification
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Notification, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Notification, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Notification> for Notification
impl PartialEq<Notification> for Notification
source§fn eq(&self, other: &Notification) -> bool
fn eq(&self, other: &Notification) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Notification
impl Serialize for Notification
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl VariantNames for Notification
impl VariantNames for Notification
impl Eq for Notification
impl StructuralEq for Notification
impl StructuralPartialEq for Notification
Auto Trait Implementations§
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnwindSafe for Notification
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.