pub struct ApiKeyServiceClient<T> { /* private fields */ }Expand description
Client for this service.
Generic over T: ClientTransport. For gRPC (HTTP/2), use
Http2Connection — it has honest poll_ready and composes with
tower::balance for multi-connection load balancing. For Connect
over HTTP/1.1 (or unknown protocol), use HttpClient.
§Working with the response
Unary calls return UnaryResponse<OwnedView<FooView>>.
view() borrows the response
message, so field access is zero-copy:
let resp = client.create_api_key(request).await?;
let name: &str = resp.view().name; // borrow into the response bufferIf you need the owned struct (e.g. to store or pass by value), use
into_owned():
let owned = client.create_api_key(request).await?.into_owned();into_view() keeps the
zero-copy decoded body (an OwnedView) without copying; field access on it
goes through .reborrow(). Streaming responses yield one
StreamMessage per received message from
.message().await — read fields zero-copy through the generated accessor
methods (msg.name()) or .view(), or convert with .to_owned_message().
Implementations§
Source§impl<T> ApiKeyServiceClient<T>
impl<T> ApiKeyServiceClient<T>
Sourcepub fn new(transport: T, config: ClientConfig) -> Self
pub fn new(transport: T, config: ClientConfig) -> Self
Create a new client with the given transport and configuration.
Sourcepub fn config(&self) -> &ClientConfig
pub fn config(&self) -> &ClientConfig
Get the client configuration.
Sourcepub fn config_mut(&mut self) -> &mut ClientConfig
pub fn config_mut(&mut self) -> &mut ClientConfig
Get a mutable reference to the client configuration.
Sourcepub async fn create_api_key(
&self,
request: CreateApiKeyRequest,
) -> Result<UnaryResponse<OwnedView<CreateApiKeyResponseView<'static>>>, ConnectError>
pub async fn create_api_key( &self, request: CreateApiKeyRequest, ) -> Result<UnaryResponse<OwnedView<CreateApiKeyResponseView<'static>>>, ConnectError>
Call the CreateApiKey RPC. Sends a request to /auth.v1.ApiKeyService/CreateApiKey.
Sourcepub async fn create_api_key_with_options(
&self,
request: CreateApiKeyRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<CreateApiKeyResponseView<'static>>>, ConnectError>
pub async fn create_api_key_with_options( &self, request: CreateApiKeyRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<CreateApiKeyResponseView<'static>>>, ConnectError>
Call the CreateApiKey RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn list_api_keys(
&self,
request: ListApiKeysRequest,
) -> Result<UnaryResponse<OwnedView<ListApiKeysResponseView<'static>>>, ConnectError>
pub async fn list_api_keys( &self, request: ListApiKeysRequest, ) -> Result<UnaryResponse<OwnedView<ListApiKeysResponseView<'static>>>, ConnectError>
Call the ListApiKeys RPC. Sends a request to /auth.v1.ApiKeyService/ListApiKeys.
Sourcepub async fn list_api_keys_with_options(
&self,
request: ListApiKeysRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<ListApiKeysResponseView<'static>>>, ConnectError>
pub async fn list_api_keys_with_options( &self, request: ListApiKeysRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<ListApiKeysResponseView<'static>>>, ConnectError>
Call the ListApiKeys RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_api_key(
&self,
request: GetApiKeyRequest,
) -> Result<UnaryResponse<OwnedView<GetApiKeyResponseView<'static>>>, ConnectError>
pub async fn get_api_key( &self, request: GetApiKeyRequest, ) -> Result<UnaryResponse<OwnedView<GetApiKeyResponseView<'static>>>, ConnectError>
Call the GetApiKey RPC. Sends a request to /auth.v1.ApiKeyService/GetApiKey.
Sourcepub async fn get_api_key_with_options(
&self,
request: GetApiKeyRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetApiKeyResponseView<'static>>>, ConnectError>
pub async fn get_api_key_with_options( &self, request: GetApiKeyRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetApiKeyResponseView<'static>>>, ConnectError>
Call the GetApiKey RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn delete_api_key(
&self,
request: DeleteApiKeyRequest,
) -> Result<UnaryResponse<OwnedView<DeleteApiKeyResponseView<'static>>>, ConnectError>
pub async fn delete_api_key( &self, request: DeleteApiKeyRequest, ) -> Result<UnaryResponse<OwnedView<DeleteApiKeyResponseView<'static>>>, ConnectError>
Call the DeleteApiKey RPC. Sends a request to /auth.v1.ApiKeyService/DeleteApiKey.
Sourcepub async fn delete_api_key_with_options(
&self,
request: DeleteApiKeyRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<DeleteApiKeyResponseView<'static>>>, ConnectError>
pub async fn delete_api_key_with_options( &self, request: DeleteApiKeyRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<DeleteApiKeyResponseView<'static>>>, ConnectError>
Call the DeleteApiKey RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn update_api_key(
&self,
request: UpdateApiKeyRequest,
) -> Result<UnaryResponse<OwnedView<UpdateApiKeyResponseView<'static>>>, ConnectError>
pub async fn update_api_key( &self, request: UpdateApiKeyRequest, ) -> Result<UnaryResponse<OwnedView<UpdateApiKeyResponseView<'static>>>, ConnectError>
Call the UpdateApiKey RPC. Sends a request to /auth.v1.ApiKeyService/UpdateApiKey.
Sourcepub async fn update_api_key_with_options(
&self,
request: UpdateApiKeyRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<UpdateApiKeyResponseView<'static>>>, ConnectError>
pub async fn update_api_key_with_options( &self, request: UpdateApiKeyRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<UpdateApiKeyResponseView<'static>>>, ConnectError>
Call the UpdateApiKey RPC with explicit per-call options. Options override ClientConfig defaults.
Trait Implementations§
Source§impl<T: Clone> Clone for ApiKeyServiceClient<T>
impl<T: Clone> Clone for ApiKeyServiceClient<T>
Source§fn clone(&self) -> ApiKeyServiceClient<T>
fn clone(&self) -> ApiKeyServiceClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more