Struct cryptid_rs::Config
source · pub struct Config<'a> { /* private fields */ }Expand description
Configuring the cryptid library.
Implementations§
source§impl<'a> Config<'a>
impl<'a> Config<'a>
sourcepub fn new(key: &'a [u8]) -> Self
pub fn new(key: &'a [u8]) -> Self
Creates a new configuration with the given master key and other settings in
default values.
mac_lengthdefaults to 4, which is large enough to make guessing impractical but still keeps the strings relatively short. High security applications may want to use a higher value.zero_pad_lengthdefaults to 4, which is large enough for most applications to never see encoded strings increase in size, while still keeping the strings relatively short.
sourcepub fn hmac_length(self, hmac_length: u8) -> Result<Self, ConfigError>
pub fn hmac_length(self, hmac_length: u8) -> Result<Self, ConfigError>
Sets the number of bytes in the HMAC. The value must be between 0 and 8.
sourcepub fn zero_pad_length(self, zero_pad_length: u8) -> Result<Self, ConfigError>
pub fn zero_pad_length(self, zero_pad_length: u8) -> Result<Self, ConfigError>
Sets the number of bytes to zero-pad numbers before encoding. The value must be between 0 and 8.
sourcepub fn set_global(config: Config<'static>)
pub fn set_global(config: Config<'static>)
Sets the global configuration. This should be called before the Field type methods
are called.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Config<'a>
impl<'a> RefUnwindSafe for Config<'a>
impl<'a> Send for Config<'a>
impl<'a> Sync for Config<'a>
impl<'a> Unpin for Config<'a>
impl<'a> UnwindSafe for Config<'a>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read more