Struct google_api_proto::google::datastore::v1::datastore_client::DatastoreClient
source · pub struct DatastoreClient<T> { /* private fields */ }
Expand description
Each RPC normalizes the partition IDs of the keys in its input entities, and always returns entities with keys with normalized partition IDs. This applies to all keys and entities, including those in values, except keys with both an empty path and an empty or unset partition ID. Normalization of input keys sets the project ID (if not already set) to the project ID from the request.
Implementations§
source§impl<T> DatastoreClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> DatastoreClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DatastoreClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn lookup(
&mut self,
request: impl IntoRequest<LookupRequest>,
) -> Result<Response<LookupResponse>, Status>
pub async fn lookup( &mut self, request: impl IntoRequest<LookupRequest>, ) -> Result<Response<LookupResponse>, Status>
Looks up entities by key.
sourcepub async fn run_query(
&mut self,
request: impl IntoRequest<RunQueryRequest>,
) -> Result<Response<RunQueryResponse>, Status>
pub async fn run_query( &mut self, request: impl IntoRequest<RunQueryRequest>, ) -> Result<Response<RunQueryResponse>, Status>
Queries for entities.
sourcepub async fn run_aggregation_query(
&mut self,
request: impl IntoRequest<RunAggregationQueryRequest>,
) -> Result<Response<RunAggregationQueryResponse>, Status>
pub async fn run_aggregation_query( &mut self, request: impl IntoRequest<RunAggregationQueryRequest>, ) -> Result<Response<RunAggregationQueryResponse>, Status>
Runs an aggregation query.
sourcepub async fn begin_transaction(
&mut self,
request: impl IntoRequest<BeginTransactionRequest>,
) -> Result<Response<BeginTransactionResponse>, Status>
pub async fn begin_transaction( &mut self, request: impl IntoRequest<BeginTransactionRequest>, ) -> Result<Response<BeginTransactionResponse>, Status>
Begins a new transaction.
sourcepub async fn commit(
&mut self,
request: impl IntoRequest<CommitRequest>,
) -> Result<Response<CommitResponse>, Status>
pub async fn commit( &mut self, request: impl IntoRequest<CommitRequest>, ) -> Result<Response<CommitResponse>, Status>
Commits a transaction, optionally creating, deleting or modifying some entities.
sourcepub async fn rollback(
&mut self,
request: impl IntoRequest<RollbackRequest>,
) -> Result<Response<RollbackResponse>, Status>
pub async fn rollback( &mut self, request: impl IntoRequest<RollbackRequest>, ) -> Result<Response<RollbackResponse>, Status>
Rolls back a transaction.
sourcepub async fn allocate_ids(
&mut self,
request: impl IntoRequest<AllocateIdsRequest>,
) -> Result<Response<AllocateIdsResponse>, Status>
pub async fn allocate_ids( &mut self, request: impl IntoRequest<AllocateIdsRequest>, ) -> Result<Response<AllocateIdsResponse>, Status>
Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted.
sourcepub async fn reserve_ids(
&mut self,
request: impl IntoRequest<ReserveIdsRequest>,
) -> Result<Response<ReserveIdsResponse>, Status>
pub async fn reserve_ids( &mut self, request: impl IntoRequest<ReserveIdsRequest>, ) -> Result<Response<ReserveIdsResponse>, Status>
Prevents the supplied keys’ IDs from being auto-allocated by Cloud Datastore.
Trait Implementations§
source§impl<T: Clone> Clone for DatastoreClient<T>
impl<T: Clone> Clone for DatastoreClient<T>
source§fn clone(&self) -> DatastoreClient<T>
fn clone(&self) -> DatastoreClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for DatastoreClient<T>
impl<T> RefUnwindSafe for DatastoreClient<T>where
T: RefUnwindSafe,
impl<T> Send for DatastoreClient<T>where
T: Send,
impl<T> Sync for DatastoreClient<T>where
T: Sync,
impl<T> Unpin for DatastoreClient<T>where
T: Unpin,
impl<T> UnwindSafe for DatastoreClient<T>where
T: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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