Skip to main content

Dollcode

Trait Dollcode 

Source
pub trait Dollcode {
    // Required methods
    fn from_dollcode(dollcode: &str) -> Option<Self>
       where Self: Sized;
    fn to_dollcode(self) -> String;
}

Required Methods§

Source

fn from_dollcode(dollcode: &str) -> Option<Self>
where Self: Sized,

Decodes a &str containing a dollcode into a Self. Returns None if dollcode contains invalid characters (everything except '▖', '▘', and '▌').

Source

fn to_dollcode(self) -> String

Takes a u64 and encodes in to a String containing a dollcode made up of '▖', '▘', and '▌'.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Dollcode for u8

Source§

impl Dollcode for u16

Source§

impl Dollcode for u32

Source§

impl Dollcode for u64

Source§

impl Dollcode for u128

Source§

impl Dollcode for usize

Implementors§