pub struct Client { /* private fields */ }
Expand description
Client is an abstraction for grouping etcd operations and managing underlying network communications.
Implementations§
Source§impl Client
impl Client
Sourcepub fn with_channel(channel: Channel, token: Option<String>) -> Self
pub fn with_channel(channel: Channel, token: Option<String>) -> Self
Build clients from tonic Channel
directly.
For advanced users, it provides the ability to control more details about the connection.
pub async fn connect_with_token( cfg: &ClientConfig, token: Option<String>, ) -> Result<Self>
Sourcepub async fn connect(cfg: ClientConfig) -> Result<Self>
pub async fn connect(cfg: ClientConfig) -> Result<Self>
Connects to etcd cluster and returns a client.
§Errors
Will returns Err
if failed to contact with given endpoints or authentication failed.
Trait Implementations§
Source§impl AuthOp for Client
impl AuthOp for Client
fn authenticate<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<AuthenticateResponse>> + Send + 'async_trait>>
Source§impl ClusterOp for Client
impl ClusterOp for Client
fn member_add<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<MemberAddResponse>> + Send + 'async_trait>>
fn member_remove<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<MemberRemoveResponse>> + Send + 'async_trait>>
fn member_update<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<MemberUpdateResponse>> + Send + 'async_trait>>
fn member_list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MemberListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl KeyValueOp for Client
impl KeyValueOp for Client
fn put<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<PutResponse>> + Send + 'async_trait>>
fn get<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<RangeResponse>> + Send + 'async_trait>>
fn get_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RangeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_by_prefix<'life0, 'async_trait, K>( &'life0 self, p: K, ) -> Pin<Box<dyn Future<Output = Result<RangeResponse>> + Send + 'async_trait>>
fn get_range<'life0, 'async_trait, F, E>( &'life0 self, from: F, end: E, ) -> Pin<Box<dyn Future<Output = Result<RangeResponse>> + Send + 'async_trait>>
fn delete<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<DeleteResponse>> + Send + 'async_trait>>
fn delete_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DeleteResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_by_prefix<'life0, 'async_trait, K>( &'life0 self, p: K, ) -> Pin<Box<dyn Future<Output = Result<DeleteResponse>> + Send + 'async_trait>>
fn delete_range<'life0, 'async_trait, F, E>( &'life0 self, from: F, end: E, ) -> Pin<Box<dyn Future<Output = Result<DeleteResponse>> + Send + 'async_trait>>
fn txn<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<TxnResponse>> + Send + 'async_trait>>
fn compact<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<CompactResponse>> + Send + 'async_trait>>
Source§impl LeaseOp for Client
impl LeaseOp for Client
fn grant_lease<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<LeaseGrantResponse>> + Send + 'async_trait>>
fn revoke<'life0, 'async_trait, R>( &'life0 self, req: R, ) -> Pin<Box<dyn Future<Output = Result<LeaseRevokeResponse>> + Send + 'async_trait>>
fn keep_alive_for<'life0, 'async_trait>(
&'life0 self,
lease_id: LeaseId,
) -> Pin<Box<dyn Future<Output = Result<LeaseKeepAlive>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn time_to_live<'life0, 'async_trait, R>(
&'life0 self,
req: R,
) -> Pin<Box<dyn Future<Output = Result<LeaseTimeToLiveResponse>> + Send + 'async_trait>>where
R: Into<LeaseTimeToLiveRequest> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
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>
Wrap the input message
T
in a tonic::Request