#[non_exhaustive]pub enum LoginInfo {
Password(Password),
Token(Token),
ApplicationService(ApplicationService),
}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: Map<String, Value>,
) -> Result<LoginInfo, Error>
pub fn new( login_type: &str, data: Map<String, Value>, ) -> Result<LoginInfo, Error>
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<LoginInfo, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<LoginInfo, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for LoginInfo
impl Serialize for LoginInfo
Source§fn 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more