pub struct ScramTypes(/* private fields */);Expand description
All supported SCRAM types.
Implementations§
Source§impl ScramTypes
impl ScramTypes
Sourcepub const fn new(table: &'static [ScramType]) -> Self
pub const fn new(table: &'static [ScramType]) -> Self
Creates a new table which can be used later. It also can be used to construct overrided table during compilation.
Sourcepub fn adrvertise<S: AsRef<str>>(&self, sep: S) -> String
pub fn adrvertise<S: AsRef<str>>(&self, sep: S) -> String
Sourcepub fn advertise_to_fmt<S: AsRef<str>>(
&self,
f: &mut Formatter<'_>,
sep: S,
) -> Result
pub fn advertise_to_fmt<S: AsRef<str>>( &self, f: &mut Formatter<'_>, sep: S, ) -> Result
Outputs all supported types to fmt with separator sep.
Sourcepub fn get_scramtype<S: AsRef<str>>(
&self,
scram: S,
) -> ScramResult<&'static ScramType>
pub fn get_scramtype<S: AsRef<str>>( &self, scram: S, ) -> ScramResult<&'static ScramType>
Retrieves the SCRAM type by name which are hardcoded in SCRAM_TYPES i.e SCRAM-SHA256.
§Arguments
scram- a scram auth type
§Returns
- ScramResult - a reference to record from table with static lifetime or Error ScramErrorCode::ExternalError if not found
Sourcepub fn get_scramtype_numeric(
&self,
scram: ScramTypeAlias,
) -> ScramResult<&'static ScramType>
pub fn get_scramtype_numeric( &self, scram: ScramTypeAlias, ) -> ScramResult<&'static ScramType>
Retrieves the SCRAM type from SCRAM_TYPES by the numeric alias which are hardcoded in ScramTypeAlias i.e SCRAM-SHA256.
§Arguments
scram- a scram numeric auth type ScramTypeAlias
§Returns
- ScramResult - a reference to record from table with static lifetime or Error ScramErrorCode::ExternalError if not found
Trait Implementations§
Source§impl Clone for ScramTypes
impl Clone for ScramTypes
Source§fn clone(&self) -> ScramTypes
fn clone(&self) -> ScramTypes
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 moreAuto Trait Implementations§
impl Freeze for ScramTypes
impl RefUnwindSafe for ScramTypes
impl Send for ScramTypes
impl Sync for ScramTypes
impl Unpin for ScramTypes
impl UnwindSafe for ScramTypes
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