[][src]Struct mediawiki::user::User

pub struct User { /* fields omitted */ }

User contains the login data for the Api

Methods

impl User[src]

pub fn new() -> User[src]

Returns a new, blank, not-logged-in user

pub fn logged_in(&self) -> bool[src]

Checks if the user is logged in

pub fn has_right(&self, right: &str) -> bool[src]

Checks is the user has a spefic right (e.g. "bot", "autocinfirmed")

pub fn is_bot(&self) -> bool[src]

Checks if the user has a bot flag

pub fn is_autoconfirmed(&self) -> bool[src]

Checks if the user is autoconfirmed

pub fn can_edit(&self) -> bool[src]

Checks if the user is allowed to edit

pub fn can_create_page(&self) -> bool[src]

Checks if the user is allowed to create a page

pub fn can_upload(&self) -> bool[src]

Checks if the user is allowed to upload a file

pub fn can_move(&self) -> bool[src]

Checks if the user is allowed to move (rename) a page

pub fn can_patrol(&self) -> bool[src]

Checks if the user is allowed to patrol edits

pub fn load_user_info(&mut self, api: &Api) -> Result<(), Box<dyn Error>>[src]

Loads the user info, which is stored in the object; returns Ok(()) if successful

pub fn user_name(&self) -> &String[src]

Returns the user name ("" if not logged in)

pub fn user_id(&self) -> u64[src]

Returns the user id (0 if not logged in)

pub fn set_from_login(&mut self, login: &Value) -> Result<(), String>[src]

Tries to set user information from the Api call

Trait Implementations

impl Clone for User[src]

impl Debug for User[src]

Auto Trait Implementations

impl RefUnwindSafe for User

impl Send for User

impl Sync for User

impl Unpin for User

impl UnwindSafe for User

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,