#[non_exhaustive]pub enum ElectionType {
Preferred,
Unclean,
}Expand description
Options for Admin::elect_leaders.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Preferred
Elect the preferred replica as leader.
Unclean
Elect any in-sync replica as leader (unclean election).
Implementations§
Source§impl ElectionType
impl ElectionType
Sourcepub fn value(&self) -> i8
pub fn value(&self) -> i8
Returns the wire-protocol byte value used to encode this election type.
Mirrors the public byte value field on Java’s ElectionType.
Sourcepub fn value_of(value: i8) -> Result<Self, Error>
pub fn value_of(value: i8) -> Result<Self, Error>
Returns the ElectionType for the given wire-protocol byte value.
§Arguments
value- the wire-protocol byte value
§Errors
Error::is_local_illegal_argument_error if value is not a valid
election type.
Trait Implementations§
Source§impl Clone for ElectionType
impl Clone for ElectionType
Source§fn clone(&self) -> ElectionType
fn clone(&self) -> ElectionType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElectionType
impl Debug for ElectionType
Source§impl Display for ElectionType
Java’s inherited Enum.toString(): the constant’s name.
impl Display for ElectionType
Java’s inherited Enum.toString(): the constant’s name.
Source§impl Hash for ElectionType
impl Hash for ElectionType
Source§impl Ord for ElectionType
impl Ord for ElectionType
Source§fn cmp(&self, other: &ElectionType) -> Ordering
fn cmp(&self, other: &ElectionType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ElectionType
impl PartialEq for ElectionType
Source§impl PartialOrd for ElectionType
impl PartialOrd for ElectionType
impl Copy for ElectionType
impl Eq for ElectionType
impl StructuralPartialEq for ElectionType
Auto Trait Implementations§
impl Freeze for ElectionType
impl RefUnwindSafe for ElectionType
impl Send for ElectionType
impl Sync for ElectionType
impl Unpin for ElectionType
impl UnsafeUnpin for ElectionType
impl UnwindSafe for ElectionType
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more