[][src]Struct radix64::configs::Crypt

pub struct Crypt;

The crypt(3) character set

(uses ./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz) without padding.

Methods

impl Crypt[src]

pub fn encode<I: ?Sized>(self, input: &I) -> String where
    I: AsRef<[u8]>, 
[src]

pub fn encode_with_buffer<'i, 'b, I: ?Sized>(
    self,
    input: &'i I,
    buffer: &'b mut Vec<u8>
) -> &'b str where
    I: AsRef<[u8]>, 
[src]

pub fn encode_slice<I: ?Sized>(self, input: &I, output: &mut [u8]) -> usize where
    I: AsRef<[u8]>, 
[src]

pub fn decode<I: ?Sized>(self, input: &I) -> Result<Vec<u8>, DecodeError> where
    I: AsRef<[u8]>, 
[src]

pub fn decode_with_buffer<'i, 'b, I: ?Sized>(
    self,
    input: &'i I,
    buffer: &'b mut Vec<u8>
) -> Result<&'b [u8], DecodeError> where
    I: AsRef<[u8]>, 
[src]

pub fn decode_slice<I: ?Sized>(
    self,
    input: &I,
    output: &mut [u8]
) -> Result<usize, DecodeError> where
    I: AsRef<[u8]>, 
[src]

Trait Implementations

impl Config for Crypt[src]

fn encode<I: ?Sized>(self, input: &I) -> String where
    I: AsRef<[u8]>, 
[src]

Encode the provided input into a String.

fn encode_with_buffer<'i, 'b, I: ?Sized>(
    self,
    input: &'i I,
    buffer: &'b mut Vec<u8>
) -> &'b str where
    I: AsRef<[u8]>, 
[src]

Encode the provided input into the provided buffer, returning a &str of the encoded input. The returned &str is a view into the beginning of the provided buffer that contains the encoded data. This method overwrites the data in the buffer, it does not append to the buffer. This method exists to provide an efficient way to amortize allocations when repeatedly encoding different inputs. The same buffer can be provided for each invocation and will only be resized when necessary. Any data in the buffer outside the range of the returned &str is not part of the encoded output and should be ignored. Read more

fn encode_slice<I: ?Sized>(self, input: &I, output: &mut [u8]) -> usize where
    I: AsRef<[u8]>, 
[src]

Encode the provided input into the provided output slice. The slice must be large enough to contain the encoded output and panics if it's not. Use input.len() * 4 / 3 + 3 as a conservative estimate. It returns the number of bytes of encoded output written to the output slice. This method allows for the most control over memory placement, but encode_with_buffer is typically more ergonomic and just as performant. Read more

fn decode<I: ?Sized>(self, input: &I) -> Result<Vec<u8>, DecodeError> where
    I: AsRef<[u8]>, 
[src]

Decode the provided input.

fn decode_with_buffer<'i, 'b, I: ?Sized>(
    self,
    input: &'i I,
    buffer: &'b mut Vec<u8>
) -> Result<&'b [u8], DecodeError> where
    I: AsRef<[u8]>, 
[src]

Decode the provided input into the provided buffer, returning a &u8 of the decoded input. The returned &u8 is a view into the beginning of the provided buffer that contains the decoded data. This method overwrites the data in the buffer, it does not append to the buffer. This method exists to provide an efficient way to amortize allocations when repeatedly decoding different inputs. The same buffer can be provided for each invocation and will only be resized when necessary. Any data in the buffer outside the range of the returned &u8 is not part of the decoded output and should be ignored. Read more

fn decode_slice<I: ?Sized>(
    self,
    input: &I,
    output: &mut [u8]
) -> Result<usize, DecodeError> where
    I: AsRef<[u8]>, 
[src]

Decode the provided input into the provided output slice. The slice must be large enough to contain the decoded output and panics if it's not. Use input.len() * 6 / 8 + 1 as a conservative estimate. It returns the number of bytes of decoded output written to the output slice. This method allows for the most control over memory placement, but decode_with_buffer is typically more ergonomic and just as performant. Read more

impl Clone for Crypt[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Crypt[src]

impl Copy for Crypt[src]

impl Debug for Crypt[src]

Auto Trait Implementations

impl Unpin for Crypt

impl Sync for Crypt

impl Send for Crypt

impl UnwindSafe for Crypt

impl RefUnwindSafe for Crypt

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]