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_length
defaults 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_length
defaults 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§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