[−][src]Struct mediawiki::user::User
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,