Skip to main content

AlgorithmOutput

Trait AlgorithmOutput 

Source
pub trait AlgorithmOutput:
    Shr<u8, Output = Self>
    + Shl<u8, Output = Self>
    + BitOrAssign<Self>
    + Sized
    + BitAnd<Self> {
    const SIZE: usize;

    // Required methods
    fn cast_to_u8(self) -> u8;
    fn cast_to_u16(self) -> u16;
    fn cast_to_u32(self) -> u32;
    fn cast_to_u64(self) -> u64;
    fn cast_to_u128(self) -> u128;
    fn get_low(self) -> bool;
}
Expand description

This is the helper trait that all Algorithms must output a type of u8,u16,u32,u64,u128,

Required Associated Constants§

Source

const SIZE: usize

The size in bytes of the algorithm output

Required Methods§

Source

fn cast_to_u8(self) -> u8

Helper function that converts to u8

Source

fn cast_to_u16(self) -> u16

Helper function that converts to u16

Source

fn cast_to_u32(self) -> u32

Helper function that converts to u32

Source

fn cast_to_u64(self) -> u64

Helper function that converts to u64

Source

fn cast_to_u128(self) -> u128

Helper function that converts to u128

Source

fn get_low(self) -> bool

Helper function returns the lowest bit of an algorithm output as a bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AlgorithmOutput for u8

Source§

impl AlgorithmOutput for u16

Source§

impl AlgorithmOutput for u32

Source§

impl AlgorithmOutput for u64

Source§

impl AlgorithmOutput for u128

Implementors§