#[non_exhaustive]pub enum LoginInfo {
Password(Password),
Token(Token),
ApplicationService(ApplicationService),
}
Available on crate feature
api
and (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§
§impl LoginInfo
impl LoginInfo
pub 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§
§impl<'de> Deserialize<'de> for LoginInfo
impl<'de> Deserialize<'de> for LoginInfo
§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
§impl Serialize for LoginInfo
impl Serialize for LoginInfo
§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 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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§fn clone_handle(handle: Handle) -> Handle
fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>