Struct digits::Digits [] [src]

pub struct Digits<'a> { /* fields omitted */ }

struct Digits

This struct acts similar to a full number with a custom numeric character base. But the underlying implementation is a linked list where all the methods recurse as far as need to to implement the operations.

Methods

impl<'a> Digits<'a>
[src]

new creates a new Digits instance with the provided character set and value.

The first parameter must be a BaseCustom object which defines and maps all values. The second parameter is a string value with all valid characters from the BaseCustom set.

You can view the numbers current value at any time with to_s() or to_string().

replicate — alias for clone (useful for unboxing)

propagate creates a new number from the same underlying numeric base

Gives the full value of all digits within the linked list as a String.

Gives the full value of all digits within the linked list as a String.

length returns a usize of the total linked list length.

zero returns a Digits instance with value of zero and the current character mapping.

new_zero returns a Digits instance with value of zero and the current character mapping.

is_zero returns bool value of if the number is zero

pinky is the smallest digit. a.k.a. current digit in the linked list. a.k.a. the right most digit. This will be a char value for that digit.

one returns a Digits instance with value of one and the current character mapping.

new_one returns a Digits instance with value of one and the current character mapping.

Add two Digits instances together. The one the add method is called on must be mutable and modifies itself. The other is consumed.

Returns a clone of the updated Self as well.

Multiply two Digits instances together. The one the mul method is called on must be mutable and modifies itself. The other is consumed.

Returns a clone of the updated Self as well.

Trait Implementations

impl<'a> Clone for Digits<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> Into<String> for Digits<'a>
[src]

NODOC

impl<'a> Display for Digits<'a>
[src]

Formats the value using the given formatter. Read more

impl<'a> Debug for Digits<'a>
[src]

Formats the value using the given formatter.