Trait Keyed

Source
pub trait Keyed {
    // Required methods
    fn new(language: &mut Language) -> Self;
    fn keys(&self) -> Vec<&dyn IoKey>;
    fn keys_mut(&mut self) -> Vec<&mut dyn IoKey>;

    // Provided methods
    fn reset(&mut self, language: &mut Language) { ... }
    fn randomize(&mut self, language: &mut Language) { ... }
    fn to_string(&self, language: &mut Language) -> String { ... }
}
Expand description

Trait implemented by ciphers that require a Key

Required Methods§

Source

fn new(language: &mut Language) -> Self

Create a new Keyed cipher, initialized with default state, which is, if possible, the identity form of each key.

§Arguments
  • language A borrowed instance of the currently loaded Language
Source

fn keys(&self) -> Vec<&dyn IoKey>

Get a vec of keys

Source

fn keys_mut(&mut self) -> Vec<&mut dyn IoKey>

Get a vec of mutable keys

Provided Methods§

Source

fn reset(&mut self, language: &mut Language)

Reset the cipher state

§Arguments
  • language A borrowed instance of the currently loaded Language
Source

fn randomize(&mut self, language: &mut Language)

Randomize the cipher state

§Arguments
  • language A borrowed instance of the currently loaded Language
Source

fn to_string(&self, language: &mut Language) -> String

Convert the cipher state to a string

§Arguments
  • language A borrowed instance of the currently loaded Language

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§