Struct etcd_client::LeaderKey [−][src]
#[repr(transparent)]pub struct LeaderKey(_);
Leader key of election
Implementations
impl LeaderKey[src]
impl LeaderKey[src]pub const fn new() -> Self[src]
Creates a new leader key.
pub fn with_name(self, name: impl Into<Vec<u8>>) -> Self[src]
The election identifier that corresponds to the leadership key.
pub fn with_key(self, key: impl Into<Vec<u8>>) -> Self[src]
An opaque key representing the ownership of the election.
pub const fn with_rev(self, rev: i64) -> Self[src]
The creation revision of the key
pub const fn with_lease(self, lease: i64) -> Self[src]
The lease ID of the election leader.
pub fn name(&self) -> &[u8][src]
The name in byte. name is the election identifier that corresponds to the leadership key.
pub fn name_str(&self) -> Result<&str, Error>[src]
The name in string. name is the election identifier that corresponds to the leadership key.
pub unsafe fn name_str_unchecked(&self) -> &str[src]
The name in string. name is the election identifier that corresponds to the leadership key.
Safety
This function is unsafe because it does not check that the bytes of the key are valid UTF-8.
If this constraint is violated, undefined behavior results,
as the rest of Rust assumes that &strs are valid UTF-8.
pub fn key(&self) -> &[u8][src]
The key in byte. key is an opaque key representing the ownership of the election. If the key is deleted, then leadership is lost.
pub fn key_str(&self) -> Result<&str, Error>[src]
The key in string. key is an opaque key representing the ownership of the election. If the key is deleted, then leadership is lost.
pub unsafe fn key_str_unchecked(&self) -> &str[src]
The key in string. key is an opaque key representing the ownership of the election. If the key is deleted, then leadership is lost.
Safety
This function is unsafe because it does not check that the bytes of the key are valid UTF-8.
If this constraint is violated, undefined behavior results,
as the rest of Rust assumes that &strs are valid UTF-8.
pub const fn rev(&self) -> i64[src]
The creation revision of the key. It can be used to test for ownership of an election during transactions by testing the key’s creation revision matches rev.
pub const fn lease(&self) -> i64[src]
The lease ID of the election leader.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LeaderKey
impl RefUnwindSafe for LeaderKeyimpl UnwindSafe for LeaderKey
impl UnwindSafe for LeaderKeyBlanket Implementations
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> IntoRequest<T> for T[src]
impl<T> IntoRequest<T> for T[src]pub fn into_request(self) -> Request<T>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>, pub fn vzip(self) -> V
impl<T> WithSubscriber for T[src]
impl<T> WithSubscriber for T[src]pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]
S: Into<Dispatch>,