pub struct PasswordGeneratorRequest {
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>,
}
Expand description
Password generator request options.
Fields§
§lowercase: bool
Include lowercase characters (a-z).
uppercase: bool
Include uppercase characters (A-Z).
numbers: bool
Include numbers (0-9).
special: bool
Include special characters: ! @ # $ % ^ & *
length: u8
The length of the generated password. Note that the password length must be greater than the sum of all the minimums.
avoid_ambiguous: bool
When 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.
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 From<PasswordGeneratorRequest> for JsValuewhere
PasswordGeneratorRequest: Serialize,
impl From<PasswordGeneratorRequest> for JsValuewhere
PasswordGeneratorRequest: Serialize,
Source§fn from(value: PasswordGeneratorRequest) -> Self
fn from(value: PasswordGeneratorRequest) -> Self
Source§impl FromWasmAbi for PasswordGeneratorRequestwhere
Self: DeserializeOwned,
impl FromWasmAbi for PasswordGeneratorRequestwhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for PasswordGeneratorRequestwhere
PasswordGeneratorRequest: Serialize,
impl IntoWasmAbi for PasswordGeneratorRequestwhere
PasswordGeneratorRequest: Serialize,
Source§impl JsonSchema for PasswordGeneratorRequest
impl JsonSchema for PasswordGeneratorRequest
Source§fn schema_name() -> String
fn schema_name() -> String
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
§fn is_referenceable() -> bool
fn is_referenceable() -> 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 OptionFromWasmAbi for PasswordGeneratorRequestwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for PasswordGeneratorRequestwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for PasswordGeneratorRequestwhere
PasswordGeneratorRequest: Serialize,
impl OptionIntoWasmAbi for PasswordGeneratorRequestwhere
PasswordGeneratorRequest: Serialize,
Source§impl RefFromWasmAbi for PasswordGeneratorRequestwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for PasswordGeneratorRequestwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
Self
are recovered from.Source§type Anchor = SelfOwner<PasswordGeneratorRequest>
type Anchor = SelfOwner<PasswordGeneratorRequest>
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl Serialize for PasswordGeneratorRequest
impl Serialize for PasswordGeneratorRequest
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}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
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
Source§impl VectorFromWasmAbi for PasswordGeneratorRequestwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for PasswordGeneratorRequestwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for PasswordGeneratorRequestwhere
PasswordGeneratorRequest: Serialize,
impl VectorIntoWasmAbi for PasswordGeneratorRequestwhere
PasswordGeneratorRequest: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Auto Trait Implementations§
impl Freeze for PasswordGeneratorRequest
impl RefUnwindSafe for PasswordGeneratorRequest
impl Send for PasswordGeneratorRequest
impl Sync for PasswordGeneratorRequest
impl Unpin for PasswordGeneratorRequest
impl UnwindSafe for PasswordGeneratorRequest
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§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>
§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>
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.