pub struct ClientBuilder<Svc> { /* private fields */ }
Implementations§
Source§impl<Svc> ClientBuilder<Svc>
impl<Svc> ClientBuilder<Svc>
Sourcepub fn new(
service: Svc,
default_namespace: impl Into<String>,
) -> ClientBuilder<Svc>
pub fn new( service: Svc, default_namespace: impl Into<String>, ) -> ClientBuilder<Svc>
Construct a ClientBuilder
from scratch with a fully custom Service
stack.
This method is only intended for advanced use cases, most users will want to use ClientBuilder::try_from
instead,
which provides a default stack as a starting point.
Sourcepub fn with_layer<L>(
self,
layer: &L,
) -> ClientBuilder<<L as Layer<Svc>>::Service>where
L: Layer<Svc>,
pub fn with_layer<L>(
self,
layer: &L,
) -> ClientBuilder<<L as Layer<Svc>>::Service>where
L: Layer<Svc>,
Sourcepub fn build<B>(self) -> Clientwhere
Svc: Service<Request<Body>, Response = Response<B>> + Send + 'static,
<Svc as Service<Request<Body>>>::Future: Send + 'static,
<Svc as Service<Request<Body>>>::Error: Into<Box<dyn Error + Send + Sync>>,
B: Body<Data = Bytes> + Send + 'static,
<B as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
pub fn build<B>(self) -> Clientwhere
Svc: Service<Request<Body>, Response = Response<B>> + Send + 'static,
<Svc as Service<Request<Body>>>::Future: Send + 'static,
<Svc as Service<Request<Body>>>::Error: Into<Box<dyn Error + Send + Sync>>,
B: Body<Data = Bytes> + Send + 'static,
<B as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
Trait Implementations§
Source§impl TryFrom<Config> for ClientBuilder<BoxService<Request<Body>, Response<Box<dyn Body<Error = Box<dyn Error + Send + Sync>, Data = Bytes> + Send + Unpin>>, Box<dyn Error + Send + Sync>>>
impl TryFrom<Config> for ClientBuilder<BoxService<Request<Body>, Response<Box<dyn Body<Error = Box<dyn Error + Send + Sync>, Data = Bytes> + Send + Unpin>>, Box<dyn Error + Send + Sync>>>
Auto Trait Implementations§
impl<Svc> Freeze for ClientBuilder<Svc>where
Svc: Freeze,
impl<Svc> RefUnwindSafe for ClientBuilder<Svc>where
Svc: RefUnwindSafe,
impl<Svc> Send for ClientBuilder<Svc>where
Svc: Send,
impl<Svc> Sync for ClientBuilder<Svc>where
Svc: Sync,
impl<Svc> Unpin for ClientBuilder<Svc>where
Svc: Unpin,
impl<Svc> UnwindSafe for ClientBuilder<Svc>where
Svc: UnwindSafe,
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