pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver;
pub use ::aws_smithy_runtime_api::client::endpoint::EndpointFuture;
pub use ::aws_smithy_types::endpoint::Endpoint;
#[cfg(test)]
mod test {
}
pub trait ResolveEndpoint: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug {
fn resolve_endpoint<'a>(&'a self, params: &'a crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a>;
fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver
where
Self: Sized + 'static,
{
::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver::new(DowncastParams(self))
}
}
#[derive(Debug)]
struct DowncastParams<T>(T);
impl<T> ::aws_smithy_runtime_api::client::endpoint::ResolveEndpoint for DowncastParams<T>
where
T: ResolveEndpoint,
{
fn resolve_endpoint<'a>(&'a self, params: &'a ::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a> {
let ep = match params.get::<crate::config::endpoint::Params>() {
Some(params) => self.0.resolve_endpoint(params),
None => ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(Err("params of expected type was not present".into())),
};
ep
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Params {
}
impl Params {
pub fn builder() -> crate::config::endpoint::ParamsBuilder {
crate::config::endpoint::ParamsBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ParamsBuilder {
}
impl ParamsBuilder {
pub fn build(self) -> ::std::result::Result<crate::config::endpoint::Params, crate::config::endpoint::InvalidParams> {
Ok(#[allow(clippy::unnecessary_lazy_evaluations)]
crate::config::endpoint::Params {
})
}
}
#[derive(Debug)]
pub struct InvalidParams {
field: std::borrow::Cow<'static, str>
}
impl InvalidParams {
#[allow(dead_code)]
fn missing(field: &'static str) -> Self {
Self { field: field.into() }
}
}
impl std::fmt::Display for InvalidParams {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "a required field was missing: `{}`", self.field)
}
}
impl std::error::Error for InvalidParams { }