kube_client::client

Struct ClientBuilder

Source
pub struct ClientBuilder<Svc> { /* private fields */ }
Available on crate feature client only.
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

Source§

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T