Struct kube_client::client::ClientBuilder

source ·
pub struct ClientBuilder<Svc> { /* private fields */ }
Expand description

Builder for Client instances with customized tower middleware.

Implementations§

source§

impl<Svc> ClientBuilder<Svc>

source

pub fn new(service: Svc, default_namespace: impl Into<String>) -> Self
where Svc: Service<Request<Body>>,

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.

source

pub fn with_layer<L: Layer<Svc>>(self, layer: &L) -> ClientBuilder<L::Service>

Add a Layer to the current Service stack.

source

pub fn build<B>(self) -> Client
where Svc: Service<Request<Body>, Response = Response<B>> + Send + 'static, Svc::Future: Send + 'static, Svc::Error: Into<BoxError>, B: Body<Data = Bytes> + Send + 'static, B::Error: Into<BoxError>,

Build a Client instance with the current Service stack.

Trait Implementations§

source§

impl TryFrom<Config> for ClientBuilder<BoxService<Request<Body>, Response<Box<DynBody>>, BoxError>>

source§

fn try_from(config: Config) -> Result<Self>

Builds a default ClientBuilder stack from a given configuration

§

type Error = Error

The type returned in the event of a conversion error.

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more