pub struct ClientBuilder { /* private fields */ }Expand description
Builder for a bounded public API client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(base_url: &str) -> Result<Self, ClientConfigError>
pub fn new(base_url: &str) -> Result<Self, ClientConfigError>
Parses one root HTTP(S) origin.
§Errors
Rejects malformed URLs, non-HTTP schemes, credentials, query strings, fragments, and non-root paths.
Sourcepub fn bearer_token(self, token: &str) -> Result<Self, ClientConfigError>
pub fn bearer_token(self, token: &str) -> Result<Self, ClientConfigError>
Configures an opaque bearer token without retaining a second copy.
§Errors
Rejects values that cannot be represented in one HTTP header.
Sourcepub fn response_bytes(self, maximum: usize) -> Self
pub fn response_bytes(self, maximum: usize) -> Self
Sets the maximum complete JSON response bytes.
Sourcepub fn witness_bytes(self, maximum: usize) -> Self
pub fn witness_bytes(self, maximum: usize) -> Self
Sets the maximum complete snapshot witness bytes.
Sourcepub fn build(self) -> Result<HyphaeClient, ClientConfigError>
pub fn build(self) -> Result<HyphaeClient, ClientConfigError>
Constructs the reusable client.
§Errors
Rejects zero limits or an underlying HTTP client configuration error.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin 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