Struct etcd_client::LeaderKey
source · [−]#[repr(transparent)]pub struct LeaderKey(_);Expand description
Leader key of election
Implementations
sourceimpl LeaderKey
impl LeaderKey
sourcepub fn with_name(self, name: impl Into<Vec<u8>>) -> Self
pub fn with_name(self, name: impl Into<Vec<u8>>) -> Self
The election identifier that corresponds to the leadership key.
sourcepub fn with_key(self, key: impl Into<Vec<u8>>) -> Self
pub fn with_key(self, key: impl Into<Vec<u8>>) -> Self
An opaque key representing the ownership of the election.
sourcepub const fn with_lease(self, lease: i64) -> Self
pub const fn with_lease(self, lease: i64) -> Self
The lease ID of the election leader.
sourcepub fn name(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn name(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
The name in byte. name is the election identifier that corresponds to the leadership key.
sourcepub fn name_str(&self) -> Result<&str, Error>
pub fn name_str(&self) -> Result<&str, Error>
The name in string. name is the election identifier that corresponds to the leadership key.
sourcepub unsafe fn name_str_unchecked(&self) -> &str
pub unsafe fn name_str_unchecked(&self) -> &str
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.
sourcepub fn key(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn key(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
The key in byte. key is an opaque key representing the ownership of the election. If the key is deleted, then leadership is lost.
sourcepub fn key_str(&self) -> Result<&str, Error>
pub fn key_str(&self) -> Result<&str, Error>
The key in string. key is an opaque key representing the ownership of the election. If the key is deleted, then leadership is lost.
sourcepub unsafe fn key_str_unchecked(&self) -> &str
pub unsafe fn key_str_unchecked(&self) -> &str
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.
Trait Implementations
sourceimpl From<&LeaderKey> for &LeaderKey
impl From<&LeaderKey> for &LeaderKey
sourcefn from(src: &PbLeaderKey) -> Self
fn from(src: &PbLeaderKey) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for LeaderKey
impl Send for LeaderKey
impl Sync for LeaderKey
impl Unpin for LeaderKey
impl UnwindSafe for LeaderKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T in a tonic::Request
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more