[−][src]Struct etcd_client::LeaderKey
Leader key of election
Implementations
impl LeaderKey
[src]
pub const fn new() -> Self
[src]
Creates a new leader key.
pub fn with_name(mut self: Self, name: impl Into<Vec<u8>>) -> Self
[src]
The election identifier that corresponds to the leadership key.
pub fn with_key(mut self: Self, key: impl Into<Vec<u8>>) -> Self
[src]
An opaque key representing the ownership of the election.
pub const fn with_rev(mut self: Self, rev: i64) -> Self
[src]
The creation revision of the key
pub const fn with_lease(mut self: 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 &str
s 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 &str
s 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
[src]
impl Send for LeaderKey
[src]
impl Sync for LeaderKey
[src]
impl Unpin for LeaderKey
[src]
impl UnwindSafe for LeaderKey
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> 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]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,