[][src]Struct convert_base::Convert

pub struct Convert { /* fields omitted */ }

Convert the radix (base) of digits stored in a vector.

Methods

impl Convert[src]

pub fn new(from: u64, to: u64) -> Self[src]

Create a new converter with from and to bases.

pub fn new_unaligned(from: u64, to: u64) -> Self[src]

Create a new converter but don't test for alignment.

pub fn convert<Input, Output>(&mut self, input: &Vec<Input>) -> Vec<Output> where
    Output: Copy + Into<u64> + From<u8> + FromU64 + Add<Output, Output = Output> + Div<Output, Output = Output> + Rem<Output, Output = Output>,
    Input: Copy + Into<u64>, 
[src]

Perform the conversion on input which contains digits in base self.from. You should specify the Output type so that the target base (self.to) fits. There are no checks to ensure the Output type has room.

For input and output vectors, the least significant digit is at the beginning of the array.

Auto Trait Implementations

impl Send for Convert

impl Sync for Convert

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]