pub struct FloopyBuilder { /* private fields */ }Expand description
Builder for Floopy. Created via Floopy::builder.
Implementations§
Source§impl FloopyBuilder
impl FloopyBuilder
Sourcepub fn base_url(self, base_url: impl Into<String>) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
Override the gateway base URL (default DEFAULT_BASE_URL). Use for
self-hosted gateways.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Set the default per-request timeout (default 60s).
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Set the retry budget for transient failures (default 2).
Sourcepub fn default_header(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn default_header( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a header sent on every Floopy-only request (highest precedence).
Sourcepub fn options(self, options: FloopyOptions) -> Self
pub fn options(self, options: FloopyOptions) -> Self
Set the default Floopy options forwarded on every request.
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
Use a caller-provided reqwest::Client for Floopy-only requests.
Sourcepub fn build(self) -> Result<Floopy>
pub fn build(self) -> Result<Floopy>
Build the client.
§Errors
Returns crate::Error::Config if the API key is empty, or
crate::Error::Connection if the default HTTP client cannot be
built.
Auto Trait Implementations§
impl Freeze for FloopyBuilder
impl !RefUnwindSafe for FloopyBuilder
impl Send for FloopyBuilder
impl Sync for FloopyBuilder
impl Unpin for FloopyBuilder
impl UnsafeUnpin for FloopyBuilder
impl !UnwindSafe for FloopyBuilder
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