Stability annotations for user.
This commit is contained in:
parent
7ee83a9b2d
commit
308a506d8f
1 changed files with 7 additions and 0 deletions
|
@ -1,7 +1,9 @@
|
||||||
//! Data for tracking user information.
|
//! Data for tracking user information.
|
||||||
|
#![unstable]
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
/// IRC User data.
|
/// IRC User data.
|
||||||
|
#[unstable]
|
||||||
#[deriving(Clone, Show)]
|
#[deriving(Clone, Show)]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
/// The user's nickname.
|
/// The user's nickname.
|
||||||
|
@ -14,6 +16,7 @@ pub struct User {
|
||||||
|
|
||||||
impl User {
|
impl User {
|
||||||
/// Creates a new User.
|
/// Creates a new User.
|
||||||
|
#[stable]
|
||||||
pub fn new(name: &str) -> User {
|
pub fn new(name: &str) -> User {
|
||||||
let rank = from_str(name);
|
let rank = from_str(name);
|
||||||
User {
|
User {
|
||||||
|
@ -27,16 +30,19 @@ impl User {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the nickname of the user.
|
/// Gets the nickname of the user.
|
||||||
|
#[stable]
|
||||||
pub fn get_name(&self) -> &str {
|
pub fn get_name(&self) -> &str {
|
||||||
self.name[]
|
self.name[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the user's access level.
|
/// Gets the user's access level.
|
||||||
|
#[experimental]
|
||||||
pub fn access_level(&self) -> AccessLevel {
|
pub fn access_level(&self) -> AccessLevel {
|
||||||
self.access_level
|
self.access_level
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updates the user's access level.
|
/// Updates the user's access level.
|
||||||
|
#[unstable]
|
||||||
pub fn update_access_level(&mut self, mode: &str) {
|
pub fn update_access_level(&mut self, mode: &str) {
|
||||||
self.access_level = match mode {
|
self.access_level = match mode {
|
||||||
"+q" => AccessLevel::Owner,
|
"+q" => AccessLevel::Owner,
|
||||||
|
@ -61,6 +67,7 @@ impl PartialEq for User {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The user's access level.
|
/// The user's access level.
|
||||||
|
#[stable]
|
||||||
#[deriving(PartialEq, Clone, Show)]
|
#[deriving(PartialEq, Clone, Show)]
|
||||||
pub enum AccessLevel {
|
pub enum AccessLevel {
|
||||||
/// The channel owner (~).
|
/// The channel owner (~).
|
||||||
|
|
Loading…
Add table
Reference in a new issue