pub struct Builder { /* private fields */ }
Expand description
A Builder
can be used to create a Modio
client with custom configuration.
Implementations§
source§impl Builder
impl Builder
sourcepub fn new<C: Into<Credentials>>(credentials: C) -> Builder
pub fn new<C: Into<Credentials>>(credentials: C) -> Builder
Constructs a new Builder
.
This is the same as Modio::builder(credentials)
.
sourcepub fn build(self) -> Result<Modio>
pub fn build(self) -> Result<Modio>
Returns a Modio
client that uses this Builder
configuration.
sourcepub fn client<F>(self, f: F) -> Builderwhere
F: FnOnce(ClientBuilder) -> ClientBuilder,
pub fn client<F>(self, f: F) -> Builderwhere
F: FnOnce(ClientBuilder) -> ClientBuilder,
Configure the underlying reqwest
client using reqwest::ClientBuilder
.
sourcepub fn host<S: Into<String>>(self, host: S) -> Builder
pub fn host<S: Into<String>>(self, host: S) -> Builder
Set the mod.io api host.
Defaults to "https://api.mod.io/v1"
sourcepub fn user_agent<V>(self, value: V) -> Builder
pub fn user_agent<V>(self, value: V) -> Builder
Set the user agent used for every request.
Defaults to "modio/{version}"
sourcepub fn proxy(self, proxy: Proxy) -> Builder
pub fn proxy(self, proxy: Proxy) -> Builder
Add a Proxy
to the list of proxies the client will use.
sourcepub fn target_platform(self, platform: TargetPlatform) -> Builder
pub fn target_platform(self, platform: TargetPlatform) -> Builder
Set the target platform.
See the mod.io docs for more information.
sourcepub fn target_portal(self, portal: TargetPortal) -> Builder
pub fn target_portal(self, portal: TargetPortal) -> Builder
Set the target portal.
See the mod.io docs for more information.
sourcepub fn use_default_tls(self) -> Builder
pub fn use_default_tls(self) -> Builder
Use native TLS backend.
sourcepub fn use_rustls_tls(self) -> Builder
pub fn use_rustls_tls(self) -> Builder
Use rustls TLS backend.
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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