Struct mini_enigma::components::Wheel
source · pub struct Wheel { /* private fields */ }
Expand description
Represents the configuration (i.e. ordering) of the Rotor
set in an Enigma machine
Implementations§
source§impl Wheel
impl Wheel
sourcepub fn new(rotors: [Rotor; 3]) -> Self
pub fn new(rotors: [Rotor; 3]) -> Self
Creates a new Rotor
configuration in left-to-right ordering
sourcepub fn set_positions(&mut self, positions: [Letter; 3])
pub fn set_positions(&mut self, positions: [Letter; 3])
Set the positions of each Rotor
in left-to-right ordering
sourcepub fn set_ring_wiring_offset(&mut self, positions: [u8; 3])
pub fn set_ring_wiring_offset(&mut self, positions: [u8; 3])
Set the wiring offset (aka ring setting) of each Rotor
in left-to-right ordering
sourcepub fn get_positions(&self) -> [Letter; 3]
pub fn get_positions(&self) -> [Letter; 3]
Get current Rotor
positions
Trait Implementations§
source§impl Ord for Wheel
impl Ord for Wheel
source§impl PartialEq for Wheel
impl PartialEq for Wheel
source§impl PartialOrd for Wheel
impl PartialOrd for Wheel
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Wheel
impl Eq for Wheel
impl StructuralPartialEq for Wheel
Auto Trait Implementations§
impl Freeze for Wheel
impl RefUnwindSafe for Wheel
impl Send for Wheel
impl Sync for Wheel
impl Unpin for Wheel
impl UnwindSafe for Wheel
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more