[][src]Struct etcd_client::LeaderKey

#[repr(transparent)]pub struct 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 &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

impl Clone for LeaderKey[src]

impl Debug for LeaderKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]