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 Freeze for OpenApiClientBuilder
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