pub struct ClientBuilder(/* private fields */);Expand description
Builder to create a Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(service_url: impl IntoUrl) -> Self
pub fn new(service_url: impl IntoUrl) -> Self
Creates a new ClientBuilder, configured with the given service_url.
To perform CRUD operations, one has to create a Client, and then scope it to a Usecase
and Scope in order to create a Session.
Sourcepub fn propagate_traces(self, propagate_traces: bool) -> Self
pub fn propagate_traces(self, propagate_traces: bool) -> Self
Changes whether the sentry-trace header will be sent to Objectstore
to take advantage of Sentry’s distributed tracing.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Sets both the connect and the read timeout for the reqwest::Client.
For more fine-grained configuration, use Self::configure_reqwest.
Sourcepub fn configure_reqwest<F>(self, closure: F) -> Self
pub fn configure_reqwest<F>(self, closure: F) -> Self
Calls the closure with the underlying reqwest::ClientBuilder.
Sourcepub fn build(self) -> Result<Client>
pub fn build(self) -> Result<Client>
Returns a Client that uses this ClientBuilder configuration.
§Errors
This method fails if:
- the given
service_urlis invalid - the
reqwest::Clientfails to build. Refer toreqwest::ClientBuilder::buildfor more information on when this can happen.
Trait Implementations§
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