Struct lychee_lib::ClientBuilder
source · pub struct ClientBuilder { /* private fields */ }
Expand description
Builder for Client
.
See crate-level documentation for usage example.
Implementations§
source§impl ClientBuilder
impl ClientBuilder
sourcepub fn builder(
) -> ClientBuilderBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder( ) -> ClientBuilderBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building ClientBuilder
.
On the builder, call .github_token(...)
(optional), .remaps(...)
(optional), .includes(...)
(optional), .excludes(...)
(optional), .exclude_all_private(...)
(optional), .exclude_private_ips(...)
(optional), .exclude_link_local_ips(...)
(optional), .exclude_loopback_ips(...)
(optional), .include_mail(...)
(optional), .max_redirects(...)
(optional), .max_retries(...)
(optional), .user_agent(...)
(optional), .allow_insecure(...)
(optional), .schemes(...)
(optional), .custom_headers(...)
(optional), .method(...)
(optional), .accepted(...)
(optional), .timeout(...)
(optional), .retry_wait_time(...)
(optional), .require_https(...)
(optional), .cookie_jar(...)
(optional), .include_fragments(...)
(optional), .plugin_request_chain(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of ClientBuilder
.
source§impl ClientBuilder
impl ClientBuilder
sourcepub fn client(self) -> Result<Client>
pub fn client(self) -> Result<Client>
Instantiates a Client
.
§Errors
Returns an Err
if:
- The user-agent contains characters other than ASCII 32-127.
- The reqwest client cannot be instantiated. This occurs if a TLS backend cannot be initialized or the resolver fails to load the system configuration. See here.
- The GitHub client cannot be created. Since the implementation also uses reqwest under the hood, this errors in the same circumstances as the last one.
Trait Implementations§
source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ClientBuilder
impl Debug for ClientBuilder
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
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>
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