Struct abcrypt_py::Params
source · 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]) -> PyResult<Self>
pub fn new(ciphertext: &[u8]) -> PyResult<Self>
Creates a new instance of the Argon2 parameters from ciphertext.
§Errors
Returns an error if any of the following are true:
ciphertextis shorter than 156 bytes.- The magic number is invalid.
- The version number is the unrecognized abcrypt version number.
- The Argon2 parameters are invalid.
sourcepub const fn memory_cost(&self) -> u32
pub const fn memory_cost(&self) -> u32
Gets memory size in KiB.
sourcepub const fn parallelism(&self) -> u32
pub const fn parallelism(&self) -> u32
Gets degree of parallelism.
Trait Implementations§
source§impl PyClassImpl for Params
impl PyClassImpl for Params
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type ThreadChecker = SendablePyClass<Params>
type ThreadChecker = SendablePyClass<Params>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl PyClassNewTextSignature<Params> for PyClassImplCollector<Params>
impl PyClassNewTextSignature<Params> for PyClassImplCollector<Params>
fn new_text_signature(self) -> Option<&'static str>
source§impl PyMethods<Params> for PyClassImplCollector<Params>
impl PyMethods<Params> for PyClassImplCollector<Params>
fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for Params
impl PyTypeInfo for Params
§type AsRefTarget = PyCell<Params>
type AsRefTarget = PyCell<Params>
Utility type to make Py::as_ref work.
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object is an instance of this type.impl Copy 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