pub struct PasswordGeneratorRequest {Show 13 fields
pub lowercase: bool,
pub uppercase: bool,
pub numbers: bool,
pub special: bool,
pub length: u8,
pub avoid_ambiguous: bool,
pub min_lowercase: Option<u8>,
pub min_uppercase: Option<u8>,
pub min_number: Option<u8>,
pub min_special: Option<u8>,
pub custom_required_chars: Option<String>,
pub custom_allowed_chars: Option<String>,
pub max_consecutive: Option<u8>,
}Expand description
Password generator request options.
Fields§
§lowercase: boolInclude lowercase characters (a-z).
uppercase: boolInclude uppercase characters (A-Z).
numbers: boolInclude numbers (0-9).
special: boolInclude special characters: ! @ # $ % ^ & *
length: u8The length of the generated password. Note that the password length must be greater than the sum of all the minimums.
avoid_ambiguous: boolWhen set to true, the generated password will not contain ambiguous characters. The ambiguous characters are: I, O, l, 0, 1
min_lowercase: Option<u8>The minimum number of lowercase characters in the generated password. When set, the value must be between 1 and 9. This value is ignored if lowercase is false.
min_uppercase: Option<u8>The minimum number of uppercase characters in the generated password. When set, the value must be between 1 and 9. This value is ignored if uppercase is false.
min_number: Option<u8>The minimum number of numbers in the generated password. When set, the value must be between 1 and 9. This value is ignored if numbers is false.
min_special: Option<u8>The minimum number of special characters in the generated password. When set, the value must be between 1 and 9. This value is ignored if special is false.
custom_required_chars: Option<String>Custom characters that must each be available to the generator and from which at least one character is guaranteed to appear in the output. Each character of the string is treated as a member of the custom required set. Non-ASCII-printable characters are silently dropped during validation.
This is primarily used by the HTML passwordrules parser to honor custom required
character classes (e.g. required: [!#$]).
custom_allowed_chars: Option<String>Custom characters that are added to the overall pool of allowed characters, but are not required to appear. Each character of the string is treated as a member of the custom allowed set. Non-ASCII-printable characters are silently dropped during validation.
This is primarily used by the HTML passwordrules parser to honor custom allowed
character classes (e.g. allowed: [-_.]).
max_consecutive: Option<u8>The maximum number of consecutive identical characters allowed in the generated password,
as expressed by the HTML passwordrules max-consecutive property. None disables
the check; Some(0) is invalid and rejected at request validation. Enforced via
re-shuffle with a single-pass repair fallback for degenerate pool sizes.
Implementations§
Source§impl PasswordGeneratorRequest
impl PasswordGeneratorRequest
Sourcefn validate_options(self) -> Result<PasswordGeneratorOptions, PasswordError>
fn validate_options(self) -> Result<PasswordGeneratorOptions, PasswordError>
Validates the request and returns an immutable struct with valid options to use with the password generator.
Trait Implementations§
Source§impl<UT> ConvertError<UT> for PasswordGeneratorRequest
impl<UT> ConvertError<UT> for PasswordGeneratorRequest
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl Debug for PasswordGeneratorRequest
impl Debug for PasswordGeneratorRequest
Source§impl Default for PasswordGeneratorRequest
impl Default for PasswordGeneratorRequest
Source§impl<'de> Deserialize<'de> for PasswordGeneratorRequest
impl<'de> Deserialize<'de> for PasswordGeneratorRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<UT> FfiConverter<UT> for PasswordGeneratorRequest
impl<UT> FfiConverter<UT> for PasswordGeneratorRequest
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl FromWasm for PasswordGeneratorRequest
Available on crate feature wasm only.
impl FromWasm for PasswordGeneratorRequest
wasm only.Source§impl JsonSchema for PasswordGeneratorRequest
impl JsonSchema for PasswordGeneratorRequest
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl<UT> Lift<UT> for PasswordGeneratorRequest
impl<UT> Lift<UT> for PasswordGeneratorRequest
Source§impl<UT> LiftRef<UT> for PasswordGeneratorRequest
impl<UT> LiftRef<UT> for PasswordGeneratorRequest
Source§impl<UT> LiftReturn<UT> for PasswordGeneratorRequest
impl<UT> LiftReturn<UT> for PasswordGeneratorRequest
Source§type ReturnType = <PasswordGeneratorRequest as Lift<UT>>::FfiType
type ReturnType = <PasswordGeneratorRequest as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for PasswordGeneratorRequest
impl<UT> Lower<UT> for PasswordGeneratorRequest
Source§impl<UT> LowerError<UT> for PasswordGeneratorRequest
impl<UT> LowerError<UT> for PasswordGeneratorRequest
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for PasswordGeneratorRequest
impl<UT> LowerReturn<UT> for PasswordGeneratorRequest
Source§type ReturnType = <PasswordGeneratorRequest as Lower<UT>>::FfiType
type ReturnType = <PasswordGeneratorRequest as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl Serialize for PasswordGeneratorRequest
impl Serialize for PasswordGeneratorRequest
Source§impl ToWasm for PasswordGeneratorRequest
Available on crate feature wasm only.
impl ToWasm for PasswordGeneratorRequest
wasm only.Source§impl Tsify for PasswordGeneratorRequest
impl Tsify for PasswordGeneratorRequest
const DECL: &'static str = "/**\n * Password generator request options.\n */\nexport interface PasswordGeneratorRequest {\n /**\n * Include lowercase characters (a-z).\n */\n lowercase: boolean;\n /**\n * Include uppercase characters (A-Z).\n */\n uppercase: boolean;\n /**\n * Include numbers (0-9).\n */\n numbers: boolean;\n /**\n * Include special characters: ! @ # $ % ^ & *\n */\n special: boolean;\n /**\n * The length of the generated password.\n * Note that the password length must be greater than the sum of all the minimums.\n */\n length: number;\n /**\n * When set to true, the generated password will not contain ambiguous characters.\n * The ambiguous characters are: I, O, l, 0, 1\n */\n avoidAmbiguous: boolean;\n /**\n * The minimum number of lowercase characters in the generated password.\n * When set, the value must be between 1 and 9. This value is ignored if lowercase is false.\n */\n minLowercase: number | undefined;\n /**\n * The minimum number of uppercase characters in the generated password.\n * When set, the value must be between 1 and 9. This value is ignored if uppercase is false.\n */\n minUppercase: number | undefined;\n /**\n * The minimum number of numbers in the generated password.\n * When set, the value must be between 1 and 9. This value is ignored if numbers is false.\n */\n minNumber: number | undefined;\n /**\n * The minimum number of special characters in the generated password.\n * When set, the value must be between 1 and 9. This value is ignored if special is false.\n */\n minSpecial: number | undefined;\n /**\n * Custom characters that must each be available to the generator and from which at least\n * one character is guaranteed to appear in the output. Each character of the string is\n * treated as a member of the custom required set. Non-ASCII-printable characters are\n * silently dropped during validation.\n *\n * This is primarily used by the HTML `passwordrules` parser to honor custom required\n * character classes (e.g. `required: [!#$]`).\n */\n customRequiredChars?: string;\n /**\n * Custom characters that are added to the overall pool of allowed characters, but are not\n * required to appear. Each character of the string is treated as a member of the custom\n * allowed set. Non-ASCII-printable characters are silently dropped during validation.\n *\n * This is primarily used by the HTML `passwordrules` parser to honor custom allowed\n * character classes (e.g. `allowed: [-_.]`).\n */\n customAllowedChars?: string;\n /**\n * The maximum number of consecutive identical characters allowed in the generated password,\n * as expressed by the HTML `passwordrules` `max-consecutive` property. `None` disables\n * the check; `Some(0)` is invalid and rejected at request validation. Enforced via\n * re-shuffle with a single-pass repair fallback for degenerate pool sizes.\n */\n maxConsecutive?: number;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
Source§type JsType = JsType
type JsType = JsType
#[wasm_bindgen] extern "C" { .. }.
[Ts<T>] is #[repr(transparent)] over this and passes it across the
ABI as a plain JS handle, which any other representation would break.fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl<UT> TypeId<UT> for PasswordGeneratorRequest
impl<UT> TypeId<UT> for PasswordGeneratorRequest
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl Freeze for PasswordGeneratorRequest
impl RefUnwindSafe for PasswordGeneratorRequest
impl Send for PasswordGeneratorRequest
impl Sync for PasswordGeneratorRequest
impl Unpin for PasswordGeneratorRequest
impl UnsafeUnpin for PasswordGeneratorRequest
impl UnwindSafe for PasswordGeneratorRequest
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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