pub struct ClientBuilder { /* private fields */ }Expand description
A builder for configuring a Client instance.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Sets the base URL for requests. Defaults to https://thunderstore.io.
Sourcepub fn use_dev_repo(self) -> Self
pub fn use_dev_repo(self) -> Self
Sets the client to use Thunderstore’s staging repository instead of the main one.
Equivalent to calling with_base_url("https://thunderstore.dev").
Sourcepub fn with_client(self, client: Client) -> Self
pub fn with_client(self, client: Client) -> Self
Sets the network client to use for requests.
See the reqwest::Client documentation for more information.
Sourcepub fn with_token(self, token: impl Into<String>) -> Self
pub fn with_token(self, token: impl Into<String>) -> Self
Sets the API token to use for requests.
This is required for some actions, such as uploading packages.
Trait Implementations§
Source§impl Debug for ClientBuilder
impl Debug for ClientBuilder
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
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
Mutably borrows from an owned value. Read more