pub enum LoginInfo {
Password(Password),
Token(Token),
ApplicationService(ApplicationService),
// some variants omitted
}
Available on crate features
client
or server
only.Expand description
The authentication mechanism.
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