pub struct UsernameConfig {
pub min_length: usize,
pub max_length: usize,
pub normalization: UsernameNormalization,
pub validator: Option<Arc<dyn UsernameValidator>>,
pub include_display_username: bool,
pub display_normalizer: Option<Arc<dyn UsernameNormalizer>>,
pub display_validator: Option<Arc<dyn UsernameValidator>>,
pub validation_order: Option<UsernameValidationOrder>,
pub display_validation_order: Option<UsernameValidationOrder>,
pub immutable_username: bool,
pub input: bool,
}Fields§
§min_length: usizeUTF-16 lengths; zero uses the upstream defaults of 3 and 30.
max_length: usize§normalization: UsernameNormalization§validator: Option<Arc<dyn UsernameValidator>>§include_display_username: bool§display_normalizer: Option<Arc<dyn UsernameNormalizer>>§display_validator: Option<Arc<dyn UsernameValidator>>§validation_order: Option<UsernameValidationOrder>§display_validation_order: Option<UsernameValidationOrder>§immutable_username: bool§input: boolAdmit usernames supplied by endpoint callers.
Implementations§
Source§impl UsernameConfig
impl UsernameConfig
pub fn normalize(&self, value: &str) -> Result<String, AuthError>
pub fn normalize_display(&self, value: &str) -> Result<String, AuthError>
pub async fn value_error( &self, value: &str, ) -> Result<Option<UsernameValidationError>, AuthError>
pub async fn validate_value( &self, value: &str, status: u16, ) -> Result<(), AuthError>
pub async fn validate_hook_value(&self, value: &str) -> Result<(), AuthError>
Sourcepub fn normalize_raw_hook_value(
&self,
value: &JsValue,
) -> Result<JsValue, AuthError>
pub fn normalize_raw_hook_value( &self, value: &JsValue, ) -> Result<JsValue, AuthError>
Normalize an untyped passwordless create-hook value without changing the string-only contract of configured native callbacks.
Sourcepub async fn validate_raw_hook_value(
&self,
value: &JsValue,
) -> Result<(), AuthError>
pub async fn validate_raw_hook_value( &self, value: &JsValue, ) -> Result<(), AuthError>
The dependency reads raw .length before its default regular expression. Numeric and boolean candidates have no length; its regular expression applies String coercion independently from later normalization.
pub async fn validate_display(&self, value: &str) -> Result<(), AuthError>
Sourcepub fn fields(&self) -> IndexMap<String, FieldConfig>
pub fn fields(&self) -> IndexMap<String, FieldConfig>
Schema input transforms run both during endpoint parsing and storage.
Trait Implementations§
Source§impl Clone for UsernameConfig
impl Clone for UsernameConfig
Source§fn clone(&self) -> UsernameConfig
fn clone(&self) -> UsernameConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 UsernameConfig
impl Debug for UsernameConfig
Source§impl Default for UsernameConfig
impl Default for UsernameConfig
Source§fn default() -> UsernameConfig
fn default() -> UsernameConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for UsernameConfig
impl !UnwindSafe for UsernameConfig
impl Freeze for UsernameConfig
impl Send for UsernameConfig
impl Sync for UsernameConfig
impl Unpin for UsernameConfig
impl UnsafeUnpin for UsernameConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more