pub struct Convert { /* private fields */ }Expand description
Convert the radix (base) of digits stored in a vector.
Implementations§
Source§impl Convert
impl Convert
Sourcepub fn new(from: u64, to: u64) -> Self
pub fn new(from: u64, to: u64) -> Self
Create a new converter with from and to bases.
Examples found in repository?
More examples
Sourcepub fn new_unaligned(from: u64, to: u64) -> Self
pub fn new_unaligned(from: u64, to: u64) -> Self
Create a new converter but don’t test for alignment.
Sourcepub fn convert<Input, Output>(&mut self, input: &[Input]) -> Vec<Output>
pub fn convert<Input, Output>(&mut self, input: &[Input]) -> Vec<Output>
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.
Examples found in repository?
More examples
Auto Trait Implementations§
impl Freeze for Convert
impl RefUnwindSafe for Convert
impl Send for Convert
impl Sync for Convert
impl Unpin for Convert
impl UnwindSafe for Convert
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more