pub struct AuthenticationData { /* private fields */ }
Expand description
Authentication data, either a login_id and password or a personal access token. Required for being able to make calls to a Mattermost instance API.
Use from_password
and from_access_token
to create
an instance of this struct.
For more information, see the Mattermost docs.
Implementations§
Source§impl AuthenticationData
impl AuthenticationData
Sourcepub fn from_password(
login_id: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn from_password( login_id: impl Into<String>, password: impl Into<String>, ) -> Self
Create a struct instance from a user’s login_id and password.
Sourcepub fn from_access_token(token: impl Into<String>) -> Self
pub fn from_access_token(token: impl Into<String>) -> Self
Create a struct instance from a user’s personal access token.
Personal access tokens must be enabled per instance by an admin.
Sourcepub fn using_password(&self) -> bool
pub fn using_password(&self) -> bool
If the auth data is using a login_id and password.
Sourcepub fn using_token(&self) -> bool
pub fn using_token(&self) -> bool
If the auth data is using a personal access token.
Trait Implementations§
Source§impl Clone for AuthenticationData
impl Clone for AuthenticationData
Source§fn clone(&self) -> AuthenticationData
fn clone(&self) -> AuthenticationData
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AuthenticationData
impl RefUnwindSafe for AuthenticationData
impl Send for AuthenticationData
impl Sync for AuthenticationData
impl Unpin for AuthenticationData
impl UnwindSafe for AuthenticationData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more