pub enum LoginType {
Password(PasswordLoginType),
Token(TokenLoginType),
Sso(SsoLoginType),
// some variants omitted
}
Available on (crate features
client-api-c
or client-api-s
) and (crate features client
or server
) and crate feature api
only.Expand description
An authentication mechanism.
Variants
Password(PasswordLoginType)
A password is supplied to authenticate.
Token(TokenLoginType)
Token-based login.
Sso(SsoLoginType)
SSO-based login.
Implementations
sourceimpl LoginType
impl LoginType
sourcepub fn new(
login_type: &str,
data: Map<String, Value>
) -> Result<LoginType, Error>
pub fn new(
login_type: &str,
data: Map<String, Value>
) -> Result<LoginType, Error>
Creates a new LoginType
with the given login_type
string and data.
Prefer to use the public variants of LoginType
where possible; this constructor is
meant be used for unsupported login types only and does not allow setting
arbitrary data for supported ones.
sourcepub fn login_type(&self) -> &str
pub fn login_type(&self) -> &str
Returns a reference to the login_type
string.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for LoginType
impl<'de> Deserialize<'de> for LoginType
sourcefn deserialize<D>(
deserializer: D
) -> Result<LoginType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<LoginType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for LoginType
impl Serialize for LoginType
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for LoginType
impl Send for LoginType
impl Sync for LoginType
impl Unpin for LoginType
impl UnwindSafe for LoginType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more