pub struct SharedConfigValidator { /* private fields */ }
Available on crate feature
client
only.Expand description
A client config validator.
Implementations§
sourcepub fn base_client_config_fn(
validator: fn(_: &RuntimeComponentsBuilder, _: &ConfigBag) -> Result<(), BoxError>,
) -> Self
pub fn base_client_config_fn( validator: fn(_: &RuntimeComponentsBuilder, _: &ConfigBag) -> Result<(), BoxError>, ) -> Self
Creates a base client validator from a function.
A base client validator gets called upon client construction. The full
config may not be available at this time (hence why it has
RuntimeComponentsBuilder
as an argument rather than RuntimeComponents
).
Any error returned from the validator function will become a panic in the
client constructor.
§Examples
Creating a validator function:
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::runtime_components::{
RuntimeComponentsBuilder,
SharedConfigValidator
};
use aws_smithy_types::config_bag::ConfigBag;
fn my_validation(
components: &RuntimeComponentsBuilder,
config: &ConfigBag
) -> Result<(), BoxError> {
if components.sleep_impl().is_none() {
return Err("I need a sleep_impl!".into());
}
Ok(())
}
let validator = SharedConfigValidator::base_client_config_fn(my_validation);
Trait Implementations§
source§fn clone(&self) -> SharedConfigValidator
fn clone(&self) -> SharedConfigValidator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreCreates a shared type from an unshared type.
Auto Trait Implementations§
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.