Struct apollo_client::open::OpenApiClientBuilder
source · pub struct OpenApiClientBuilder { /* private fields */ }
Available on crate feature
open
only.Expand description
The builder for OpenApiClient.
Implementations§
source§impl OpenApiClientBuilder
impl OpenApiClientBuilder
sourcepub fn new(portal_url: Url, token: impl ToString) -> ApolloClientResult<Self>
pub fn new(portal_url: Url, token: impl ToString) -> ApolloClientResult<Self>
Create a builder.
sourcepub fn with_client_builder(
self,
f: impl FnOnce(ClientBuilder) -> ClientBuilder
) -> Self
pub fn with_client_builder( self, f: impl FnOnce(ClientBuilder) -> ClientBuilder ) -> Self
Customize inner http client.
Example
use apollo_client::open::OpenApiClientBuilder;
use std::time::Duration;
OpenApiClientBuilder::new(
"http://127.0.0.1:8070/".parse().unwrap(),
"391cc4053f8cce2e452a0e6db8925bbba503f434",
)
.unwrap()
.with_client_builder(|builder| builder.timeout(Duration::from_secs(6)));
sourcepub fn build(self) -> ApolloClientResult<OpenApiClient>
pub fn build(self) -> ApolloClientResult<OpenApiClient>
Build the OpenApiClient.
Auto Trait Implementations§
impl !RefUnwindSafe for OpenApiClientBuilder
impl Send for OpenApiClientBuilder
impl Sync for OpenApiClientBuilder
impl Unpin for OpenApiClientBuilder
impl !UnwindSafe for OpenApiClientBuilder
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