#[non_exhaustive]pub enum LoginInfo {
Password(Password),
Token(Token),
ApplicationService(ApplicationService),
}
Available on crate features
client
or server
only.Expand description
The authentication mechanism.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Password(Password)
An identifier and password are supplied to authenticate.
Token(Token)
Token-based login.
ApplicationService(ApplicationService)
Application Service-specific login.
Implementations§
Source§impl LoginInfo
impl LoginInfo
Sourcepub fn new(login_type: &str, data: JsonObject) -> Result<Self>
pub fn new(login_type: &str, data: JsonObject) -> Result<Self>
Creates a new IncomingLoginInfo
with the given login_type
string, session and data.
Prefer to use the public variants of IncomingLoginInfo
where possible; this
constructor is meant be used for unsupported authentication mechanisms only and
does not allow setting arbitrary data for supported ones.
§Errors
Returns an error if the login_type
is known and serialization of data
to the
corresponding IncomingLoginInfo
variant fails.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LoginInfo
impl<'de> Deserialize<'de> for LoginInfo
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LoginInfo
impl RefUnwindSafe for LoginInfo
impl Send for LoginInfo
impl Sync for LoginInfo
impl Unpin for LoginInfo
impl UnwindSafe for LoginInfo
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