pub struct GoogleApiClient<B, C>{ /* private fields */ }Implementations§
Source§impl<B, C> GoogleApiClient<B, C>
impl<B, C> GoogleApiClient<B, C>
pub async fn with_token_source<S: AsRef<str>>( builder: B, google_api_url: S, cloud_resource_prefix: Option<String>, token_source_type: TokenSourceType, token_scopes: Vec<String>, ) -> Result<Self>
pub async fn with_token_source_and_headers<S: AsRef<str>>( builder: B, google_api_url: S, cloud_resource_prefix: Option<String>, token_source_type: TokenSourceType, token_scopes: Vec<String>, additional_headers: HeaderMap, ) -> Result<Self>
pub async fn with_token_source_and_middleware<S: AsRef<str>>( builder: B, google_api_url: S, middleware: GoogleAuthMiddlewareLayer, ) -> Result<Self>
pub fn get(&self) -> C
Sourcepub fn get_with<C2>(
&self,
f: impl FnOnce(GoogleAuthMiddlewareService<Channel>) -> C2,
) -> C2
pub fn get_with<C2>( &self, f: impl FnOnce(GoogleAuthMiddlewareService<Channel>) -> C2, ) -> C2
Builds a client of another API on this client’s authenticated channel: same connection, token source and headers, for an API served from the same endpoint (Firestore’s admin and long-running operations services, for example).
Sourcepub async fn connect_with_endpoint<C2, S: AsRef<str>>(
&self,
builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C2,
google_api_url: S,
cloud_resource_prefix: Option<String>,
) -> Result<GoogleApi<C2>>
pub async fn connect_with_endpoint<C2, S: AsRef<str>>( &self, builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C2, google_api_url: S, cloud_resource_prefix: Option<String>, ) -> Result<GoogleApi<C2>>
Builds a client of an API served from another endpoint that reuses this client’s authentication: one token generator, so the token is fetched and refreshed once for both clients (BigQuery and Cloud Storage, for example).
Unlike get_with, which shares the channel and so reaches only
the same host, this opens a new channel to google_api_url. The user agent,
x-goog-api-client and additional headers are carried over;
google-cloud-resource-prefix is not, since another API usually needs another
prefix or none, and is set from cloud_resource_prefix instead.
pub fn amend_user_agent(self, user_agent: String) -> Result<Self>
pub fn amend_x_goog_api_client(self, x_goog_api_client: String) -> Result<Self>
Source§impl<C> GoogleApiClient<GoogleApiClientBuilderFunction<C>, C>
impl<C> GoogleApiClient<GoogleApiClientBuilderFunction<C>, C>
pub async fn from_function<S: AsRef<str>>( builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C, google_api_url: S, cloud_resource_prefix_meta: Option<String>, ) -> Result<Self>
pub async fn from_function_with_headers<S: AsRef<str>>( builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C, google_api_url: S, cloud_resource_prefix_meta: Option<String>, headers: HeaderMap, ) -> Result<Self>
pub async fn from_function_with_scopes<S: AsRef<str>>( builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C, google_api_url: S, cloud_resource_prefix_meta: Option<String>, token_scopes: Vec<String>, ) -> Result<Self>
pub async fn from_function_with_scopes_and_headers<S: AsRef<str>>( builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C, google_api_url: S, cloud_resource_prefix_meta: Option<String>, token_scopes: Vec<String>, headers: HeaderMap, ) -> Result<Self>
pub async fn from_function_with_token_source<S: AsRef<str>>( builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C, google_api_url: S, cloud_resource_prefix_meta: Option<String>, token_scopes: Vec<String>, token_source_type: TokenSourceType, ) -> Result<Self>
pub async fn from_function_with_token_source_and_headers<S: AsRef<str>>( builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C, google_api_url: S, cloud_resource_prefix_meta: Option<String>, token_scopes: Vec<String>, token_source_type: TokenSourceType, headers: HeaderMap, ) -> Result<Self>
pub async fn from_function_with_middleware<S: AsRef<str>>( builder_fn: fn(GoogleAuthMiddlewareService<Channel>) -> C, google_api_url: S, middleware: GoogleAuthMiddlewareLayer, ) -> Result<Self>
Trait Implementations§
Source§impl<B, C> Clone for GoogleApiClient<B, C>
impl<B, C> Clone for GoogleApiClient<B, C>
Auto Trait Implementations§
impl<B, C> !RefUnwindSafe for GoogleApiClient<B, C>
impl<B, C> !UnwindSafe for GoogleApiClient<B, C>
impl<B, C> Freeze for GoogleApiClient<B, C>
impl<B, C> Send for GoogleApiClient<B, C>
impl<B, C> Sync for GoogleApiClient<B, C>
impl<B, C> Unpin for GoogleApiClient<B, C>
impl<B, C> UnsafeUnpin for GoogleApiClient<B, C>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request