pub struct OptionsBuilder { /* private fields */ }
Expand description
A builder for the options
Example:
ⓘ
let authentication = SecretKeyCredential::new("test".to_string(), "test".to_string());
OptionsBuilder::new(authentication)
.with_license("test_license")
.with_logging()
.build()
Implementations§
Source§impl OptionsBuilder
impl OptionsBuilder
Sourcepub fn new(authentication: Option<Box<dyn Authenticate>>) -> Self
pub fn new(authentication: Option<Box<dyn Authenticate>>) -> Self
Creates a new OptionsBuilder, taking in the authentication for the options.
Sourcepub fn build(self) -> Options
pub fn build(self) -> Options
Builds the builder into options with the parameters you set Returns an error if authentication is not set
Sourcepub fn with_license(self, license: &str) -> Self
pub fn with_license(self, license: &str) -> Self
Adds a license string to the options
Sourcepub fn with_retries(self, num_retries: u64) -> Self
pub fn with_retries(self, num_retries: u64) -> Self
Forces a maximum number of retries that a request will attempt to handle.
Sourcepub fn with_logging(self) -> Self
pub fn with_logging(self) -> Self
Enables Logging
Sourcepub fn with_headers(self, headers: Vec<(String, String)>) -> Self
pub fn with_headers(self, headers: Vec<(String, String)>) -> Self
Adds a set of custom headers to your request.
Sourcepub fn with_proxy(self, proxy: Proxy) -> Self
pub fn with_proxy(self, proxy: Proxy) -> Self
Adds a custom proxy for the request to point to.
Auto Trait Implementations§
impl !Freeze for OptionsBuilder
impl !RefUnwindSafe for OptionsBuilder
impl Send for OptionsBuilder
impl Sync for OptionsBuilder
impl Unpin for OptionsBuilder
impl !UnwindSafe for OptionsBuilder
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