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) 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 more