aws_smithy_runtime_api/client/auth/
static_resolver.rs
1use crate::box_error::BoxError;
7use crate::client::auth::{AuthSchemeId, AuthSchemeOptionResolverParams, ResolveAuthSchemeOptions};
8use std::borrow::Cow;
9
10#[derive(Debug)]
12pub struct StaticAuthSchemeOptionResolver {
13 auth_scheme_options: Vec<AuthSchemeId>,
14}
15
16impl StaticAuthSchemeOptionResolver {
17 pub fn new(auth_scheme_options: Vec<AuthSchemeId>) -> Self {
19 Self {
20 auth_scheme_options,
21 }
22 }
23}
24
25impl ResolveAuthSchemeOptions for StaticAuthSchemeOptionResolver {
26 fn resolve_auth_scheme_options(
27 &self,
28 _params: &AuthSchemeOptionResolverParams,
29 ) -> Result<Cow<'_, [AuthSchemeId]>, BoxError> {
30 Ok(Cow::Borrowed(&self.auth_scheme_options))
31 }
32}
33
34#[derive(Debug)]
36pub struct StaticAuthSchemeOptionResolverParams;
37
38impl StaticAuthSchemeOptionResolverParams {
39 pub fn new() -> Self {
41 Self
42 }
43}
44
45impl From<StaticAuthSchemeOptionResolverParams> for AuthSchemeOptionResolverParams {
46 fn from(params: StaticAuthSchemeOptionResolverParams) -> Self {
47 AuthSchemeOptionResolverParams::new(params)
48 }
49}