#[non_exhaustive]pub struct UiaaInfo {
pub flows: Vec<AuthFlow>,
pub completed: Vec<AuthType>,
pub params: Option<Box<RawValue>>,
pub session: Option<String>,
pub auth_error: Option<StandardErrorBody>,
}client or server only.Expand description
Information about available authentication flows and status for User-Interactive Authenticiation API.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.flows: Vec<AuthFlow>List of authentication flows available for this endpoint.
completed: Vec<AuthType>List of stages in the current flow completed by the client.
params: Option<Box<RawValue>>Authentication parameters required for the client to complete authentication.
To create a Box<RawJsonValue>, use serde_json::value::to_raw_value.
session: Option<String>Session key for client to use to complete authentication.
auth_error: Option<StandardErrorBody>Authentication-related errors for previous request returned by homeserver.
Implementations§
Source§impl UiaaInfo
impl UiaaInfo
Sourcepub fn params<'a, T: Deserialize<'a>>(
&'a self,
auth_type: &AuthType,
) -> Result<Option<T>, Error>
pub fn params<'a, T: Deserialize<'a>>( &'a self, auth_type: &AuthType, ) -> Result<Option<T>, Error>
Get the parameters for the given AuthType, if they are available in the params object.
Returns Ok(Some(_)) if the parameters for the authentication type were found and the
deserialization worked, Ok(None) if the parameters for the authentication type were not
found, and Err(_) if the parameters for the authentication type were found but their
deserialization failed.
§Example
use ruma_client_api::uiaa::{AuthType, LoginTermsParams};
let login_terms_params = uiaa_info.params::<LoginTermsParams>(&AuthType::Terms)?;