aboutsummaryrefslogtreecommitdiffstats
path: root/mumlib/src/command.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-06-15 12:50:01 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-06-15 12:50:01 +0200
commited4b641f6d4816325aa07e0f13b6132c1c4dafa2 (patch)
treeb0ebd0d3af041bc1a3b940a131260f77a63ee53b /mumlib/src/command.rs
parent64978fa17b6e0882d6bacb6e626b0bc9ead2c81d (diff)
downloadmum-ed4b641f6d4816325aa07e0f13b6132c1c4dafa2.tar.gz
more mumlib doc just because
Diffstat (limited to 'mumlib/src/command.rs')
-rw-r--r--mumlib/src/command.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs
index 642c8b9..3c56130 100644
--- a/mumlib/src/command.rs
+++ b/mumlib/src/command.rs
@@ -11,7 +11,9 @@ use std::fmt;
/// Something that happened in our channel at a point in time.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MumbleEvent {
+ /// When the event occured.
pub timestamp: NaiveDateTime,
+ /// What occured.
pub kind: MumbleEventKind
}
@@ -24,11 +26,17 @@ impl fmt::Display for MumbleEvent {
/// The different kinds of events that can happen.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum MumbleEventKind {
+ /// A user connected to the server and joined our channel. Contains `(user, channel)`.
UserConnected(String, String),
+ /// A user disconnected from the server while in our channel. Contains `(user, channel)`.
UserDisconnected(String, String),
+ /// A user {un,}{muted,deafened}. Contains a rendered message with what changed and the user.
UserMuteStateChanged(String), // This logic is kinda weird so we only store the rendered message.
+ /// A text message was received. Contains who sent the message.
TextMessageReceived(String),
+ /// A user switched to our channel from some other channel. Contains `(user, previous-channel)`.
UserJoinedChannel(String, String),
+ /// A user switched from our channel to some other channel. Contains `(user, new-channel)`.
UserLeftChannel(String, String),
}