Skip to main content

NotificationType

Enum NotificationType 

Source
pub enum NotificationType {
Show 29 variants FriendRequestSent { request_id: u64, from_user_id: u64, to_user_id: u64, message: String, }, FriendRequestAccepted { request_id: u64, user_id: u64, username: String, avatar: Option<String>, }, FriendRequestRejected { request_id: u64, user_id: u64, }, FriendDeleted { user_id: u64, username: String, }, GroupCreated { group_id: u64, group_name: String, creator_id: u64, creator_name: String, member_count: u32, }, GroupMemberJoined { group_id: u64, group_name: String, user_id: u64, username: String, invited_by: Option<u64>, inviter_name: Option<String>, }, GroupMemberLeft { group_id: u64, group_name: String, user_id: u64, username: String, }, GroupMemberKicked { group_id: u64, group_name: String, user_id: u64, username: String, kicked_by: u64, kicker_name: String, reason: Option<String>, }, GroupNameChanged { group_id: u64, old_name: String, new_name: String, changed_by: u64, changer_name: String, }, GroupAvatarChanged { group_id: u64, group_name: String, changed_by: u64, changer_name: String, new_avatar_url: String, }, GroupAnnouncementChanged { group_id: u64, group_name: String, announcement: String, changed_by: u64, changer_name: String, }, GroupOwnerTransferred { group_id: u64, group_name: String, old_owner_id: u64, old_owner_name: String, new_owner_id: u64, new_owner_name: String, }, GroupAdminAdded { group_id: u64, group_name: String, user_id: u64, username: String, added_by: u64, adder_name: String, }, GroupAdminRemoved { group_id: u64, group_name: String, user_id: u64, username: String, removed_by: u64, remover_name: String, }, GroupMemberMuted { group_id: u64, group_name: String, user_id: u64, username: String, duration_seconds: u64, muted_by: u64, muter_name: String, reason: Option<String>, }, GroupMemberUnmuted { group_id: u64, group_name: String, user_id: u64, username: String, unmuted_by: u64, unmuter_name: String, }, GroupDismissed { group_id: u64, group_name: String, dismissed_by: u64, dismisser_name: String, }, RedPacketSent { red_packet_id: String, from_user_id: u64, from_username: String, total_amount: i64, count: u32, message: String, red_packet_type: RedPacketType, }, RedPacketReceived { red_packet_id: String, user_id: u64, username: String, amount: i64, timestamp: i64, }, RedPacketEmpty { red_packet_id: String, total_received: u32, total_amount: i64, }, RedPacketExpired { red_packet_id: String, remaining_count: u32, remaining_amount: i64, }, MessageRevoked { server_message_id: u64, channel_id: u64, revoked_by: u64, revoker_name: String, revoked_at: i64, }, MessagePinned { server_message_id: u64, channel_id: u64, pinned_by: u64, pinner_name: String, pinned_at: i64, }, MessageUnpinned { server_message_id: u64, channel_id: u64, unpinned_by: u64, unpinner_name: String, unpinned_at: i64, }, MessageRead { server_message_id: u64, channel_id: u64, reader_id: u64, reader_name: String, read_at: i64, }, MessageEdited { server_message_id: u64, channel_id: u64, editor_id: u64, editor_name: String, old_content: String, new_content: String, edited_at: i64, }, SystemMaintenance { title: String, content: String, start_time: i64, end_time: i64, level: MaintenanceLevel, }, SystemAnnouncement { announcement_id: u64, title: String, content: String, level: AnnouncementLevel, published_at: i64, }, SystemVersionUpdate { version: String, description: String, update_url: String, force_update: bool, },
}
Expand description

系统通知类型枚举

用于各种会话中的系统通知消息,如好友请求、群组操作、红包等

Variants§

§

FriendRequestSent

好友请求已发送

Fields

§request_id: u64
§from_user_id: u64
§to_user_id: u64
§message: String
§

FriendRequestAccepted

好友请求被接受

Fields

§request_id: u64
§user_id: u64
§username: String
§avatar: Option<String>
§

FriendRequestRejected

好友请求被拒绝

Fields

§request_id: u64
§user_id: u64
§

FriendDeleted

好友被删除

Fields

§user_id: u64
§username: String
§

GroupCreated

群组创建

Fields

§group_id: u64
§group_name: String
§creator_id: u64
§creator_name: String
§member_count: u32
§

GroupMemberJoined

成员加入群组

Fields

§group_id: u64
§group_name: String
§user_id: u64
§username: String
§invited_by: Option<u64>
§inviter_name: Option<String>
§

GroupMemberLeft

成员离开群组

Fields

§group_id: u64
§group_name: String
§user_id: u64
§username: String
§

GroupMemberKicked

成员被踢出群组

Fields

§group_id: u64
§group_name: String
§user_id: u64
§username: String
§kicked_by: u64
§kicker_name: String
§reason: Option<String>
§

GroupNameChanged

群组名称修改

Fields

§group_id: u64
§old_name: String
§new_name: String
§changed_by: u64
§changer_name: String
§

GroupAvatarChanged

群组头像修改

Fields

§group_id: u64
§group_name: String
§changed_by: u64
§changer_name: String
§new_avatar_url: String
§

GroupAnnouncementChanged

群组公告修改

Fields

§group_id: u64
§group_name: String
§announcement: String
§changed_by: u64
§changer_name: String
§

GroupOwnerTransferred

群主转让

Fields

§group_id: u64
§group_name: String
§old_owner_id: u64
§old_owner_name: String
§new_owner_id: u64
§new_owner_name: String
§

GroupAdminAdded

管理员添加

Fields

§group_id: u64
§group_name: String
§user_id: u64
§username: String
§added_by: u64
§adder_name: String
§

GroupAdminRemoved

管理员移除

Fields

§group_id: u64
§group_name: String
§user_id: u64
§username: String
§removed_by: u64
§remover_name: String
§

GroupMemberMuted

成员被禁言

Fields

§group_id: u64
§group_name: String
§user_id: u64
§username: String
§duration_seconds: u64
§muted_by: u64
§muter_name: String
§reason: Option<String>
§

GroupMemberUnmuted

成员解除禁言

Fields

§group_id: u64
§group_name: String
§user_id: u64
§username: String
§unmuted_by: u64
§unmuter_name: String
§

GroupDismissed

群组被解散

Fields

§group_id: u64
§group_name: String
§dismissed_by: u64
§dismisser_name: String
§

RedPacketSent

红包发送

Fields

§red_packet_id: String
§from_user_id: u64
§from_username: String
§total_amount: i64
§count: u32
§message: String
§red_packet_type: RedPacketType
§

RedPacketReceived

红包被领取

Fields

§red_packet_id: String
§user_id: u64
§username: String
§amount: i64
§timestamp: i64
§

RedPacketEmpty

红包已抢完

Fields

§red_packet_id: String
§total_received: u32
§total_amount: i64
§

RedPacketExpired

红包过期

Fields

§red_packet_id: String
§remaining_count: u32
§remaining_amount: i64
§

MessageRevoked

消息被撤回

Fields

§server_message_id: u64
§channel_id: u64
§revoked_by: u64
§revoker_name: String
§revoked_at: i64
§

MessagePinned

消息被置顶

Fields

§server_message_id: u64
§channel_id: u64
§pinned_by: u64
§pinner_name: String
§pinned_at: i64
§

MessageUnpinned

消息取消置顶

Fields

§server_message_id: u64
§channel_id: u64
§unpinned_by: u64
§unpinner_name: String
§unpinned_at: i64
§

MessageRead

消息已读(已读回执)

Fields

§server_message_id: u64
§channel_id: u64
§reader_id: u64
§reader_name: String
§read_at: i64
§

MessageEdited

消息被编辑

Fields

§server_message_id: u64
§channel_id: u64
§editor_id: u64
§editor_name: String
§old_content: String
§new_content: String
§edited_at: i64
§

SystemMaintenance

系统维护通知

Fields

§title: String
§content: String
§start_time: i64
§end_time: i64
§

SystemAnnouncement

系统公告

Fields

§announcement_id: u64
§title: String
§content: String
§published_at: i64
§

SystemVersionUpdate

版本更新通知

Fields

§version: String
§description: String
§update_url: String
§force_update: bool

Trait Implementations§

Source§

impl Clone for NotificationType

Source§

fn clone(&self) -> NotificationType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NotificationType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NotificationType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for NotificationType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,