pub struct ClientFactory {
pub name: String,
pub factory_env: Box<dyn Fn() -> Box<dyn ProviderClient>>,
pub factory_val: Box<dyn Fn(ProviderValue) -> Box<dyn ProviderClient>>,
}
Fields§
§name: String
§factory_env: Box<dyn Fn() -> Box<dyn ProviderClient>>
§factory_val: Box<dyn Fn(ProviderValue) -> Box<dyn ProviderClient>>
Implementations§
Source§impl ClientFactory
impl ClientFactory
pub fn new<F1, F2>(name: &str, func_env: F1, func_val: F2) -> Selfwhere
F1: 'static + Fn() -> Box<dyn ProviderClient>,
F2: 'static + Fn(ProviderValue) -> Box<dyn ProviderClient>,
pub fn build(&self) -> Result<Box<dyn ProviderClient>, ClientBuildError>
pub fn build_from_val( &self, val: ProviderValue, ) -> Result<Box<dyn ProviderClient>, ClientBuildError>
Trait Implementations§
impl RefUnwindSafe for ClientFactory
impl UnwindSafe for ClientFactory
Auto Trait Implementations§
impl Freeze for ClientFactory
impl !Send for ClientFactory
impl !Sync for ClientFactory
impl Unpin for ClientFactory
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> 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>
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>
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 more