Added more stability markers.
This commit is contained in:
parent
b27f1cb03c
commit
8a4a7d3414
6 changed files with 34 additions and 3 deletions
|
@ -24,7 +24,7 @@ pub type NetConnection = Connection<BufferedReader<NetStream>, BufferedWriter<Ne
|
|||
/// An internal type
|
||||
type NetReaderWriterPair = (BufferedReader<NetStream>, BufferedWriter<NetStream>);
|
||||
|
||||
|
||||
#[stable]
|
||||
impl Connection<BufferedReader<NetStream>, BufferedWriter<NetStream>> {
|
||||
/// Creates a thread-safe TCP connection to the specified server.
|
||||
#[stable]
|
||||
|
@ -104,6 +104,7 @@ impl Connection<BufferedReader<NetStream>, BufferedWriter<NetStream>> {
|
|||
}
|
||||
}
|
||||
|
||||
#[stable]
|
||||
impl<T: IrcReader, U: IrcWriter> Connection<T, U> {
|
||||
/// Creates a new connection from an IrcReader and an IrcWriter.
|
||||
#[stable]
|
||||
|
|
|
@ -209,7 +209,6 @@ pub enum Command<'a> {
|
|||
|
||||
impl<'a> ToMessage for Command<'a> {
|
||||
/// Converts a Command into a Message.
|
||||
#[stable]
|
||||
fn to_message(&self) -> Message {
|
||||
match *self {
|
||||
Command::PASS(p) => Message::new(None, "PASS", None, Some(p)),
|
||||
|
@ -321,6 +320,7 @@ impl<'a> ToMessage for Command<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[stable]
|
||||
impl<'a> Command<'a> {
|
||||
/// Converts a Message into a Command.
|
||||
#[stable]
|
||||
|
@ -1011,23 +1011,32 @@ impl<'a> Command<'a> {
|
|||
#[derive(Copy, Show, PartialEq)]
|
||||
pub enum CapSubCommand {
|
||||
/// Requests a list of the server's capabilities.
|
||||
#[stable]
|
||||
LS,
|
||||
/// Requests a list of the server's capabilities.
|
||||
#[stable]
|
||||
LIST,
|
||||
/// Requests specific capabilities blindly.
|
||||
#[stable]
|
||||
REQ,
|
||||
/// Acknowledges capabilities.
|
||||
#[stable]
|
||||
ACK,
|
||||
/// Does not acknowledge certain capabilities.
|
||||
#[stable]
|
||||
NAK,
|
||||
/// Requests that the server clears the capabilities of this client.
|
||||
#[stable]
|
||||
CLEAR,
|
||||
/// Ends the capability negotiation before registration.
|
||||
#[stable]
|
||||
END
|
||||
}
|
||||
|
||||
#[stable]
|
||||
impl CapSubCommand {
|
||||
/// Gets the string that corresponds to this subcommand.
|
||||
#[stable]
|
||||
pub fn to_str(&self) -> &str {
|
||||
match self {
|
||||
&CapSubCommand::LS => "LS",
|
||||
|
@ -1057,7 +1066,6 @@ impl FromStr for CapSubCommand {
|
|||
}
|
||||
|
||||
/// Produces an invalid_input IoError.
|
||||
#[stable]
|
||||
fn invalid_input() -> IoError {
|
||||
IoError {
|
||||
kind: InvalidInput,
|
||||
|
|
|
@ -12,37 +12,52 @@ use rustc_serialize::json::decode;
|
|||
#[stable]
|
||||
pub struct Config {
|
||||
/// A list of the owners of the bot by nickname.
|
||||
#[stable]
|
||||
pub owners: Option<Vec<String>>,
|
||||
/// The bot's nickname.
|
||||
#[stable]
|
||||
pub nickname: Option<String>,
|
||||
/// The bot's NICKSERV password.
|
||||
#[stable]
|
||||
pub nick_password: Option<String>,
|
||||
/// Alternative nicknames for the bots, if the default is taken.
|
||||
#[stable]
|
||||
pub alt_nicks: Option<Vec<String>>,
|
||||
/// The bot's username.
|
||||
#[stable]
|
||||
pub username: Option<String>,
|
||||
/// The bot's real name.
|
||||
#[stable]
|
||||
pub realname: Option<String>,
|
||||
/// The server to connect to.
|
||||
#[stable]
|
||||
pub server: Option<String>,
|
||||
/// The port to connect on.
|
||||
#[stable]
|
||||
pub port: Option<u16>,
|
||||
/// The password to connect to the server.
|
||||
#[stable]
|
||||
pub password: Option<String>,
|
||||
/// Whether or not to use SSL.
|
||||
/// Bots will automatically panic if this is enabled without SSL support.
|
||||
#[stable]
|
||||
pub use_ssl: Option<bool>,
|
||||
/// The encoding type used for this connection.
|
||||
/// This is typically UTF-8, but could be something else.
|
||||
#[stable]
|
||||
pub encoding: Option<String>,
|
||||
/// A list of channels to join on connection.
|
||||
#[stable]
|
||||
pub channels: Option<Vec<String>>,
|
||||
/// The text that'll be sent in response to CTCP USERINFO requests.
|
||||
#[stable]
|
||||
pub user_info: Option<String>,
|
||||
/// A map of additional options to be stored in config.
|
||||
#[stable]
|
||||
pub options: Option<HashMap<String, String>>,
|
||||
}
|
||||
|
||||
#[stable]
|
||||
impl Config {
|
||||
/// Loads a JSON configuration from the desired path.
|
||||
#[stable]
|
||||
|
|
|
@ -8,16 +8,21 @@ use std::str::FromStr;
|
|||
#[derive(Clone, PartialEq, Show)]
|
||||
pub struct Message {
|
||||
/// The message prefix (or source) as defined by [RFC 2812](http://tools.ietf.org/html/rfc2812).
|
||||
#[stable]
|
||||
pub prefix: Option<String>,
|
||||
/// The IRC command as defined by [RFC 2812](http://tools.ietf.org/html/rfc2812).
|
||||
#[stable]
|
||||
pub command: String,
|
||||
/// The command arguments.
|
||||
#[stable]
|
||||
pub args: Vec<String>,
|
||||
/// The message suffix as defined by [RFC 2812](http://tools.ietf.org/html/rfc2812).
|
||||
/// This is the only part of the message that is allowed to contain spaces.
|
||||
#[stable]
|
||||
pub suffix: Option<String>,
|
||||
}
|
||||
|
||||
#[stable]
|
||||
impl Message {
|
||||
/// Creates a new Message.
|
||||
#[stable]
|
||||
|
|
|
@ -430,6 +430,7 @@ pub enum Response {
|
|||
ERR_USERSDONTMATCH = 502,
|
||||
}
|
||||
|
||||
#[stable]
|
||||
impl Response {
|
||||
/// Gets a response from a message.
|
||||
#[stable]
|
||||
|
|
|
@ -17,6 +17,7 @@ pub struct User {
|
|||
access_levels: Vec<AccessLevel>,
|
||||
}
|
||||
|
||||
#[stable]
|
||||
impl User {
|
||||
/// Creates a new User.
|
||||
#[stable]
|
||||
|
|
Loading…
Add table
Reference in a new issue