pub struct SharedClientProtocol<Req = Request, Res = Response> { /* private fields */ }Expand description
A shared, type-erased client protocol stored in a [ConfigBag].
Wraps Arc<dyn ClientProtocol<Req, Res>> so a protocol can be stored and
retrieved from the config bag for runtime protocol selection.
Defaults to HTTP transport types. Custom transports would use
SharedClientProtocol<MyReq, MyRes> and would need their own Storable
adaptation (not provided here — today only HTTP has a Storable impl,
reflecting the fact that the orchestrator is HTTP-concrete).
Implementations§
Sourcepub fn new<P>(protocol: P) -> Selfwhere
P: ClientProtocol<Req, Res> + 'static,
pub fn new<P>(protocol: P) -> Selfwhere
P: ClientProtocol<Req, Res> + 'static,
Creates a new shared protocol from any ClientProtocol<Req, Res> impl.
In practice callers pass a concrete type that implements
ClientProtocolInner — the blanket impl<P: ClientProtocolInner> ClientProtocol<P::Request, P::Response> for P makes every
ClientProtocolInner automatically usable here.
Trait Implementations§
Source§type Storer = StoreReplace<SharedClientProtocol>
type Storer = StoreReplace<SharedClientProtocol>
Specify how an item is stored in the config bag, e.g. [
StoreReplace] and [StoreAppend]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,
§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.