Struct surf_disco::client::ClientBuilder
source · pub struct ClientBuilder<E: Error, VER: StaticVersionType> { /* private fields */ }
Expand description
Interface to specify optional configuration values before creating a Client.
Implementations§
source§impl<E: Error, VER: StaticVersionType> ClientBuilder<E, VER>
impl<E: Error, VER: StaticVersionType> ClientBuilder<E, VER>
sourcepub fn set_timeout(self, timeout: Option<Duration>) -> Self
pub fn set_timeout(self, timeout: Option<Duration>) -> Self
Set connection timeout duration.
Passing None
will remove the timeout.
Default: Some(Duration::from_secs(60))
.
sourcepub fn content_type(self, content_type: ContentType) -> Self
pub fn content_type(self, content_type: ContentType) -> Self
Set the content type used for responses.
Trait Implementations§
source§impl<E: Error, VER: StaticVersionType> From<ClientBuilder<E, VER>> for Client<E, VER>
impl<E: Error, VER: StaticVersionType> From<ClientBuilder<E, VER>> for Client<E, VER>
source§fn from(builder: ClientBuilder<E, VER>) -> Self
fn from(builder: ClientBuilder<E, VER>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<E, VER> Freeze for ClientBuilder<E, VER>
impl<E, VER> !RefUnwindSafe for ClientBuilder<E, VER>
impl<E, VER> Send for ClientBuilder<E, VER>
impl<E, VER> Sync for ClientBuilder<E, VER>
impl<E, VER> Unpin for ClientBuilder<E, VER>
impl<E, VER> !UnwindSafe for ClientBuilder<E, VER>
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
§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 more