#[non_exhaustive]pub enum ScramMechanism {
Unknown,
ScramSha256,
ScramSha512,
}Expand description
Representation of a SASL/SCRAM Mechanism.
See KIP-554: Add Broker-side SCRAM Config API.
This code is duplicated in
crate::common::security::scram::internals::ScramMechanism. The type field
in both files must match and must not change. The type field is used both for
passing ScramCredentialUpsertion and for the internal
UserScramCredentialRecord. Do not change the type field.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unknown
An unknown / unsupported mechanism (type indicator 0).
ScramSha256
SCRAM-SHA-256 (type indicator 1).
ScramSha512
SCRAM-SHA-512 (type indicator 2).
Implementations§
Source§impl ScramMechanism
impl ScramMechanism
Sourcepub fn from_type(type: i8) -> ScramMechanism
pub fn from_type(type: i8) -> ScramMechanism
Returns the instance corresponding to the given type indicator, otherwise
ScramMechanism::Unknown.
Mirrors ScramMechanism.fromType(byte).
Sourcepub fn from_mechanism_name(mechanism_name: &str) -> ScramMechanism
pub fn from_mechanism_name(mechanism_name: &str) -> ScramMechanism
Returns the mechanism corresponding to the SASL SCRAM mechanism name,
otherwise ScramMechanism::Unknown.
Mirrors ScramMechanism.fromMechanismName(String).
Sourcepub fn mechanism_name(self) -> &'static str
pub fn mechanism_name(self) -> &'static str
Returns the SASL SCRAM mechanism name (e.g. SCRAM-SHA-256).
Derived from the variant name with _ replaced by -, matching Java’s
toString().replace('_', '-').
Mirrors ScramMechanism.mechanismName().
Trait Implementations§
Source§impl Clone for ScramMechanism
impl Clone for ScramMechanism
Source§fn clone(&self) -> ScramMechanism
fn clone(&self) -> ScramMechanism
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScramMechanism
impl Debug for ScramMechanism
Source§impl Hash for ScramMechanism
impl Hash for ScramMechanism
Source§impl PartialEq for ScramMechanism
impl PartialEq for ScramMechanism
impl Copy for ScramMechanism
impl Eq for ScramMechanism
impl StructuralPartialEq for ScramMechanism
Auto Trait Implementations§
impl Freeze for ScramMechanism
impl RefUnwindSafe for ScramMechanism
impl Send for ScramMechanism
impl Sync for ScramMechanism
impl Unpin for ScramMechanism
impl UnsafeUnpin for ScramMechanism
impl UnwindSafe for ScramMechanism
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
§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
key and return true if they are equal.