pub struct KvClient<T> { /* private fields */ }Implementations§
Source§impl<T> KvClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> KvClient<T>where
T: GrpcService<Body>,
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,
) -> KvClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::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 range(
&mut self,
request: impl IntoRequest<RangeRequest>,
) -> Result<Response<RangeResponse>, Status>
pub async fn range( &mut self, request: impl IntoRequest<RangeRequest>, ) -> Result<Response<RangeResponse>, Status>
Range gets the keys in the range from the key-value store.
Sourcepub async fn put(
&mut self,
request: impl IntoRequest<PutRequest>,
) -> Result<Response<PutResponse>, Status>
pub async fn put( &mut self, request: impl IntoRequest<PutRequest>, ) -> Result<Response<PutResponse>, Status>
Put puts the given key into the key-value store. A put request increments the revision of the key-value store and generates one event in the event history.
Sourcepub async fn delete_range(
&mut self,
request: impl IntoRequest<DeleteRangeRequest>,
) -> Result<Response<DeleteRangeResponse>, Status>
pub async fn delete_range( &mut self, request: impl IntoRequest<DeleteRangeRequest>, ) -> Result<Response<DeleteRangeResponse>, Status>
DeleteRange deletes the given range from the key-value store. A delete request increments the revision of the key-value store and generates a delete event in the event history for every deleted key.
Sourcepub async fn txn(
&mut self,
request: impl IntoRequest<TxnRequest>,
) -> Result<Response<TxnResponse>, Status>
pub async fn txn( &mut self, request: impl IntoRequest<TxnRequest>, ) -> Result<Response<TxnResponse>, Status>
Txn processes multiple requests in a single transaction. A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is not allowed to modify the same key several times within one txn.
Sourcepub async fn compact(
&mut self,
request: impl IntoRequest<CompactionRequest>,
) -> Result<Response<CompactionResponse>, Status>
pub async fn compact( &mut self, request: impl IntoRequest<CompactionRequest>, ) -> Result<Response<CompactionResponse>, Status>
Compact compacts the event history in the etcd key-value store. The key-value store should be periodically compacted or the event history will continue to grow indefinitely.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for KvClient<T>
impl<T> RefUnwindSafe for KvClient<T>where
T: RefUnwindSafe,
impl<T> Send for KvClient<T>where
T: Send,
impl<T> Sync for KvClient<T>where
T: Sync,
impl<T> Unpin for KvClient<T>where
T: Unpin,
impl<T> UnwindSafe for KvClient<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
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