Struct GeneralPurpose
pub struct GeneralPurpose { /* private fields */ }
A general-purpose base64 engine.
- It uses no vector CPU instructions, so it will work on any system. For a version that uses
SIMD where available, see the SIMD engines behind the
simd-unsafefeature. - It is reasonably fast (~2-3GiB/s).
- It is not constant-time, though, so it is vulnerable to timing side-channel attacks. For loading cryptographic keys, etc, it is suggested to use the forthcoming constant-time implementation.
Implementations
impl GeneralPurpose
const fn new(alphabet: &Alphabet, config: GeneralPurposeConfig) -> SelfCreate a
GeneralPurposeengine from an [Alphabet].While not very expensive to initialize, ideally these should be cached if the engine will be used repeatedly.
Trait Implementations
impl Clone for GeneralPurpose
fn clone(&self) -> GeneralPurpose
impl Debug for GeneralPurpose
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Engine for GeneralPurpose
type Config = GeneralPurposeConfig;type DecodeEstimate = GeneralPurposeEstimate;fn config(&self) -> &Self::Configfn padding(&self) -> Symbol
Auto Trait Implementations
impl Freeze for GeneralPurpose
impl RefUnwindSafe for GeneralPurpose
impl Send for GeneralPurpose
impl Sync for GeneralPurpose
impl Unpin for GeneralPurpose
impl UnsafeUnpin for GeneralPurpose
impl UnwindSafe for GeneralPurpose
Blanket Implementations
impl<T> Any for GeneralPurpose
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for GeneralPurpose
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for GeneralPurpose
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for GeneralPurpose
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for GeneralPurpose
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for GeneralPurpose
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for GeneralPurpose
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for GeneralPurpose
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for GeneralPurpose
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>