pub struct Params(/* private fields */);
Expand description
The Argon2 parameters used for the encrypted data.
Implementations§
Source§impl Params
impl Params
Sourcepub fn new(ciphertext: &[u8]) -> Result<Self, JsError>
pub fn new(ciphertext: &[u8]) -> Result<Self, JsError>
Creates a new instance of the Argon2 parameters from ciphertext
.
§Errors
Returns an error if any of the following are true:
ciphertext
is shorter than 164 bytes.- The magic number is invalid.
- The version number is the unsupported abcrypt version number.
- The version number is the unrecognized abcrypt version number.
- The Argon2 type is invalid.
- The Argon2 version is invalid.
- The Argon2 parameters are invalid.
Sourcepub fn memory_cost(&self) -> u32
pub fn memory_cost(&self) -> u32
Gets memory size in KiB.
Sourcepub fn parallelism(&self) -> u32
pub fn parallelism(&self) -> u32
Gets degree of parallelism.
Trait Implementations§
Source§impl FromWasmAbi for Params
impl FromWasmAbi for Params
Source§impl IntoWasmAbi for Params
impl IntoWasmAbi for Params
Source§impl LongRefFromWasmAbi for Params
impl LongRefFromWasmAbi for Params
Source§impl OptionFromWasmAbi for Params
impl OptionFromWasmAbi for Params
Source§impl OptionIntoWasmAbi for Params
impl OptionIntoWasmAbi for Params
Source§impl RefFromWasmAbi for Params
impl RefFromWasmAbi for Params
Source§impl RefMutFromWasmAbi for Params
impl RefMutFromWasmAbi for Params
Source§impl TryFromJsValue for Params
impl TryFromJsValue for Params
Source§impl VectorFromWasmAbi for Params
impl VectorFromWasmAbi for Params
Source§impl VectorIntoWasmAbi for Params
impl VectorIntoWasmAbi for Params
impl Copy for Params
impl SupportsConstructor for Params
impl SupportsInstanceProperty for Params
impl SupportsStaticProperty for Params
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.