Struct magic_crypt::MagicCrypt
source · [−]pub struct MagicCrypt { /* private fields */ }
Expand description
This struct can help you encrypt or decrypt data in a quick way.
Implementations
Trait Implementations
sourceimpl Clone for MagicCrypt
impl Clone for MagicCrypt
sourcefn clone(&self) -> MagicCrypt
fn clone(&self) -> MagicCrypt
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MagicCrypt
impl Debug for MagicCrypt
sourceimpl MagicCryptTrait for MagicCrypt
impl MagicCryptTrait for MagicCrypt
fn new<S: AsRef<str>, V: AsRef<str>>(key: S, iv: Option<V>) -> MagicCrypt
fn encrypt_to_bytes<T: ?Sized + AsRef<[u8]>>(&self, data: &T) -> Vec<u8>
fn encrypt_reader_to_bytes(
&self,
reader: &mut dyn Read
) -> Result<Vec<u8>, MagicCryptError>
fn encrypt_reader_to_writer2<N: ArrayLength<u8> + PartialDiv<U16> + IsGreaterOrEqual<U16, Output = True>>(
&self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), MagicCryptError>
fn decrypt_bytes_to_bytes<T: ?Sized + AsRef<[u8]>>(
&self,
bytes: &T
) -> Result<Vec<u8>, MagicCryptError>
fn decrypt_reader_to_bytes(
&self,
reader: &mut dyn Read
) -> Result<Vec<u8>, MagicCryptError>
fn decrypt_reader_to_writer2<N: ArrayLength<u8> + PartialDiv<U16> + IsGreaterOrEqual<U16, Output = True> + Add<B1>>(
&self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), MagicCryptError> where
<N as Add<B1>>::Output: ArrayLength<u8>,
fn encrypt_str_to_base64<S: AsRef<str>>(&self, string: S) -> String
fn encrypt_str_to_bytes<S: AsRef<str>>(&self, string: S) -> Vec<u8>
fn encrypt_bytes_to_base64<T: ?Sized + AsRef<[u8]>>(&self, bytes: &T) -> String
fn encrypt_bytes_to_bytes<T: ?Sized + AsRef<[u8]>>(&self, bytes: &T) -> Vec<u8>
fn encrypt_to_base64<T: ?Sized + AsRef<[u8]>>(&self, data: &T) -> String
fn encrypt_reader_to_base64(
&self,
reader: &mut dyn Read
) -> Result<String, MagicCryptError>
fn encrypt_reader_to_writer(
&self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), MagicCryptError>
fn decrypt_base64_to_string<S: AsRef<str>>(
&self,
base64: S
) -> Result<String, MagicCryptError>
fn decrypt_base64_to_bytes<S: AsRef<str>>(
&self,
base64: S
) -> Result<Vec<u8>, MagicCryptError>
fn decrypt_reader_to_writer(
&self,
reader: &mut dyn Read,
writer: &mut dyn Write
) -> Result<(), MagicCryptError>
Auto Trait Implementations
impl RefUnwindSafe for MagicCrypt
impl Send for MagicCrypt
impl Sync for MagicCrypt
impl Unpin for MagicCrypt
impl UnwindSafe for MagicCrypt
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more