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