[−][src]Struct convert_base::Convert
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]
Output: Copy + Into<u64> + From<u8> + FromU64 + Add<Output, Output = Output> + Div<Output, Output = Output> + Rem<Output, Output = Output>,
Input: Copy + Into<u64>,
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
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,