Added documentation.
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
//! Internal representations of incoming events.
|
||||
|
||||
use irc::proto::{Command, Message};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Represents an event. Probably from IRC.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct Event {
|
||||
/// Who is the message from?
|
||||
from: String,
|
||||
/// What is the message?
|
||||
message: String,
|
||||
}
|
||||
|
||||
impl Event {
|
||||
/// Creates a new message.
|
||||
pub fn new(from: impl Into<String>, msg: impl Into<String>) -> Self {
|
||||
Self {
|
||||
from: from.into(),
|
||||
|
||||
Reference in New Issue
Block a user