[][src]Struct bacon_cipher::codecs::char_codec::CharCodecV2

pub struct CharCodecV2<T> { /* fields omitted */ }

A codec that encodes data of type char.

The encoding is done by substituting with two given elements (elem_a and elem_b) of type T.

The substitution is done using the second version of the Bacon's cipher.

Implementations

impl<T> CharCodecV2<T>[src]

pub fn new(elem_a: T, elem_b: T) -> CharCodecV2<T>[src]

Create a new CharCodec using elements elem_a and elem_b for substitution.

Trait Implementations

impl<T: PartialEq + Clone> BaconCodec for CharCodecV2<T>[src]

type ABTYPE = T

The type of the substitution characters A and B that produce a cipher output like ABABBBABBABAAABAABAAAAABABAAAAAABAABAABAABABBAABAABAAABBAAABAAAAAAABBAAABAA Read more

type CONTENT = char

The type of the content to be encoded to or decoded.

impl<T: Clone> Clone for CharCodecV2<T>[src]

impl Default for CharCodecV2<char>[src]

fn default() -> CharCodecV2<char>[src]

A CharCodec with CONTENT=char, A='A' and B='B'

It encodes the following secret: ['M', 'y', ' ', 's', 'e', 'c', 'r', 'e', 't'] is

To: ['a', 'b', 'a', 'b', 'b', 'b', 'a', 'b', 'b', 'a', 'b', 'a', 'a', 'a', 'b', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'b', 'a', 'a', 'b', 'a']

impl<T: PartialEq> PartialEq<CharCodecV2<T>> for CharCodecV2<T>[src]

impl<T> StructuralPartialEq for CharCodecV2<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for CharCodecV2<T> where
    T: RefUnwindSafe

impl<T> Send for CharCodecV2<T> where
    T: Send

impl<T> Sync for CharCodecV2<T> where
    T: Sync

impl<T> Unpin for CharCodecV2<T> where
    T: Unpin

impl<T> UnwindSafe for CharCodecV2<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.