pub struct HttpAdapterFactory {
pub interface_name: &'static str,
pub type_id_fn: fn() -> TypeId,
pub construct: fn(peer: PeerEntry) -> Box<dyn Any + Send + Sync>,
}Expand description
Factory entry for a #[wagon] trait’s remote client adapter.
Macro-generated code submits one of these per full-codegen trait via
inventory::submit! so client::<dyn T>() can discover the
trait-specific client constructor at runtime, indexed by TypeId.
construct accepts a PeerEntry (HTTP or Lambda) and returns the
adapter wrapped as Arc<dyn T> then erased into Box<dyn Any + Send + Sync> (because Arc<dyn T>: Any for T: 'static). The SDK downcasts
back to Arc<T> in client::<T>(). The macro-generated adapter
internally branches per PeerEntry variant to pick HTTP-bearer or
SigV4 dispatch at each call.
Fields§
§interface_name: &'static str§type_id_fn: fn() -> TypeId§construct: fn(peer: PeerEntry) -> Box<dyn Any + Send + Sync>Trait Implementations§
impl Collect for HttpAdapterFactory
Auto Trait Implementations§
impl Freeze for HttpAdapterFactory
impl RefUnwindSafe for HttpAdapterFactory
impl Send for HttpAdapterFactory
impl Sync for HttpAdapterFactory
impl Unpin for HttpAdapterFactory
impl UnsafeUnpin for HttpAdapterFactory
impl UnwindSafe for HttpAdapterFactory
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> 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.