pub struct Builder { /* private fields */ }Expand description
Fluent API for configuring a client.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn set_custom_auth(&mut self, auth: AuthHeaderManager) -> &mut Self
pub fn set_custom_auth(&mut self, auth: AuthHeaderManager) -> &mut Self
Sourcepub fn set_oidc_credentials(&mut self, auth: AuthenticatorConfig) -> &mut Self
pub fn set_oidc_credentials(&mut self, auth: AuthenticatorConfig) -> &mut Self
Sourcepub fn set_project(&mut self, project: &str) -> &mut Self
pub fn set_project(&mut self, project: &str) -> &mut Self
Sourcepub fn set_app_name(&mut self, app_name: &str) -> &mut Self
pub fn set_app_name(&mut self, app_name: &str) -> &mut Self
Set the value of the x-cdp-app header.
Sourcepub fn set_internal_client(&mut self, client: Client) -> &mut Self
pub fn set_internal_client(&mut self, client: Client) -> &mut Self
Set the reqwest client used internally. If your application connects to a large number of different CDF projects, or uses a large number of different sets of credentials. It is recommended to share a single reqwest client.
§Arguments
client- reqwest client to use.
Sourcepub fn set_client_config(&mut self, config: ClientConfig) -> &mut Self
pub fn set_client_config(&mut self, config: ClientConfig) -> &mut Self
Sourcepub fn set_base_url(&mut self, base_url: &str) -> &mut Self
pub fn set_base_url(&mut self, base_url: &str) -> &mut Self
Set the base URL used by the client.
§Arguments
base_url- Cognite API base URL, for examplehttps://api.cognitedata.com
Sourcepub fn with_custom_middleware(
&mut self,
middleware: Arc<dyn Middleware>,
) -> &mut Self
pub fn with_custom_middleware( &mut self, middleware: Arc<dyn Middleware>, ) -> &mut Self
Sourcepub fn build(self) -> Result<CogniteClient>
pub fn build(self) -> Result<CogniteClient>
Create a cognite client. This may fail if not all required parameters are provided.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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