pub struct CyberdropClientBuilder { /* private fields */ }Expand description
Builder for CyberdropClient.
Implementations§
Source§impl CyberdropClientBuilder
impl CyberdropClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new builder using the crate defaults.
This is equivalent to CyberdropClient::builder.
Sourcepub fn base_url(self, base_url: impl AsRef<str>) -> Result<Self, CyberdropError>
pub fn base_url(self, base_url: impl AsRef<str>) -> Result<Self, CyberdropError>
Override the base URL used for requests.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Set a custom user agent header.
Sourcepub fn auth_token(self, token: impl Into<String>) -> Self
pub fn auth_token(self, token: impl Into<String>) -> Self
Provide an auth token that will be sent as bearer auth.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Configure the request timeout.
This sets reqwest::ClientBuilder::timeout, which applies a single deadline per request.
Timeout failures surface as CyberdropError::Http.
Sourcepub fn build(self) -> Result<CyberdropClient, CyberdropError>
pub fn build(self) -> Result<CyberdropClient, CyberdropError>
Build a CyberdropClient.
If no base URL is configured, this uses https://cyberdrop.cr/.
If no user agent is configured, a browser-like UA string is used.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CyberdropClientBuilder
impl !RefUnwindSafe for CyberdropClientBuilder
impl Send for CyberdropClientBuilder
impl Sync for CyberdropClientBuilder
impl Unpin for CyberdropClientBuilder
impl UnsafeUnpin for CyberdropClientBuilder
impl !UnwindSafe for CyberdropClientBuilder
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