pub struct SharedConfigValidator { /* private fields */ }
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Creates a shared type from an unshared type.