Improved the documentation for irc::proto::message a bit.

This commit is contained in:
Aaron Weiss 2017-12-13 20:38:04 +01:00
parent 4ec2212dbd
commit dcac92084f
No known key found for this signature in database
GPG key ID: 047D32DF25DC22EF

View file

@ -1,4 +1,4 @@
//! Messages to and from the server. //! A module providing a data structure for messages to and from IRC servers.
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::fmt::{Display, Formatter, Result as FmtResult}; use std::fmt::{Display, Formatter, Result as FmtResult};
use std::str::FromStr; use std::str::FromStr;
@ -7,7 +7,7 @@ use error;
use error::{Error, ErrorKind}; use error::{Error, ErrorKind};
use proto::{Command, ChannelExt}; use proto::{Command, ChannelExt};
/// IRC Message data. /// A data structure representing an IRC message according to the protocol specification.
#[derive(Clone, PartialEq, Debug)] #[derive(Clone, PartialEq, Debug)]
pub struct Message { pub struct Message {
/// Message tags as defined by [IRCv3.2](http://ircv3.net/specs/core/message-tags-3.2.html). /// Message tags as defined by [IRCv3.2](http://ircv3.net/specs/core/message-tags-3.2.html).
@ -19,7 +19,7 @@ pub struct Message {
} }
impl Message { impl Message {
/// Creates a new Message. /// Creates a new message from the given components.
pub fn new( pub fn new(
prefix: Option<&str>, prefix: Option<&str>,
command: &str, command: &str,
@ -29,7 +29,7 @@ impl Message {
Message::with_tags(None, prefix, command, args, suffix) Message::with_tags(None, prefix, command, args, suffix)
} }
/// Creates a new Message optionally including IRCv3.2 message tags. /// Creates a new IRCv3.2 message from the given components, including message tags.
pub fn with_tags( pub fn with_tags(
tags: Option<Vec<Tag>>, tags: Option<Vec<Tag>>,
prefix: Option<&str>, prefix: Option<&str>,