Trait malachite_base::num::conversion::traits::VecFromOtherType
source · [−]pub trait VecFromOtherType<T>: Sized {
fn vec_from_other_type(value: T) -> Vec<Self>;
}
Expand description
Converts a slice of one type of value to a Vec
of another type.
Required Methods
fn vec_from_other_type(value: T) -> Vec<Self>
Implementations on Foreign Types
sourceimpl VecFromOtherType<u8> for u8
impl VecFromOtherType<u8> for u8
sourcefn vec_from_other_type(x: u8) -> Vec<Self>
fn vec_from_other_type(x: u8) -> Vec<Self>
Converts a value of one type to a Vec
of the same type.
In this case, it just creates a one-element Vec
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u16> for u16
impl VecFromOtherType<u16> for u16
sourcefn vec_from_other_type(x: u16) -> Vec<Self>
fn vec_from_other_type(x: u16) -> Vec<Self>
Converts a value of one type to a Vec
of the same type.
In this case, it just creates a one-element Vec
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u32> for u32
impl VecFromOtherType<u32> for u32
sourcefn vec_from_other_type(x: u32) -> Vec<Self>
fn vec_from_other_type(x: u32) -> Vec<Self>
Converts a value of one type to a Vec
of the same type.
In this case, it just creates a one-element Vec
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u64> for u64
impl VecFromOtherType<u64> for u64
sourcefn vec_from_other_type(x: u64) -> Vec<Self>
fn vec_from_other_type(x: u64) -> Vec<Self>
Converts a value of one type to a Vec
of the same type.
In this case, it just creates a one-element Vec
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u128> for u128
impl VecFromOtherType<u128> for u128
sourcefn vec_from_other_type(x: u128) -> Vec<Self>
fn vec_from_other_type(x: u128) -> Vec<Self>
Converts a value of one type to a Vec
of the same type.
In this case, it just creates a one-element Vec
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<usize> for usize
impl VecFromOtherType<usize> for usize
sourcefn vec_from_other_type(x: usize) -> Vec<Self>
fn vec_from_other_type(x: usize) -> Vec<Self>
Converts a value of one type to a Vec
of the same type.
In this case, it just creates a one-element Vec
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u16> for u8
impl VecFromOtherType<u16> for u8
sourcefn vec_from_other_type(x: u16) -> Vec<Self>
fn vec_from_other_type(x: u16) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u32> for u8
impl VecFromOtherType<u32> for u8
sourcefn vec_from_other_type(x: u32) -> Vec<Self>
fn vec_from_other_type(x: u32) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u32> for u16
impl VecFromOtherType<u32> for u16
sourcefn vec_from_other_type(x: u32) -> Vec<Self>
fn vec_from_other_type(x: u32) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u64> for u8
impl VecFromOtherType<u64> for u8
sourcefn vec_from_other_type(x: u64) -> Vec<Self>
fn vec_from_other_type(x: u64) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u64> for u16
impl VecFromOtherType<u64> for u16
sourcefn vec_from_other_type(x: u64) -> Vec<Self>
fn vec_from_other_type(x: u64) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u64> for u32
impl VecFromOtherType<u64> for u32
sourcefn vec_from_other_type(x: u64) -> Vec<Self>
fn vec_from_other_type(x: u64) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u128> for u8
impl VecFromOtherType<u128> for u8
sourcefn vec_from_other_type(x: u128) -> Vec<Self>
fn vec_from_other_type(x: u128) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u128> for u16
impl VecFromOtherType<u128> for u16
sourcefn vec_from_other_type(x: u128) -> Vec<Self>
fn vec_from_other_type(x: u128) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u128> for u32
impl VecFromOtherType<u128> for u32
sourcefn vec_from_other_type(x: u128) -> Vec<Self>
fn vec_from_other_type(x: u128) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u128> for u64
impl VecFromOtherType<u128> for u64
sourcefn vec_from_other_type(x: u128) -> Vec<Self>
fn vec_from_other_type(x: u128) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u128> for usize
impl VecFromOtherType<u128> for usize
sourcefn vec_from_other_type(x: u128) -> Vec<Self>
fn vec_from_other_type(x: u128) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<usize> for u8
impl VecFromOtherType<usize> for u8
sourcefn vec_from_other_type(x: usize) -> Vec<Self>
fn vec_from_other_type(x: usize) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<usize> for u16
impl VecFromOtherType<usize> for u16
sourcefn vec_from_other_type(x: usize) -> Vec<Self>
fn vec_from_other_type(x: usize) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a smaller unsigned
type.
The input value will be broken up into several values in the output Vec
.
$f(x) = (y_k){k=0}^{m-1}$, where $x = \sum{j=0}^{m-1}2^{jW}y_j$ and $m = 2^{V-W}n$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u8> for u16
impl VecFromOtherType<u8> for u16
sourcefn vec_from_other_type(x: u8) -> Vec<Self>
fn vec_from_other_type(x: u8) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u8> for u32
impl VecFromOtherType<u8> for u32
sourcefn vec_from_other_type(x: u8) -> Vec<Self>
fn vec_from_other_type(x: u8) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u8> for u64
impl VecFromOtherType<u8> for u64
sourcefn vec_from_other_type(x: u8) -> Vec<Self>
fn vec_from_other_type(x: u8) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u8> for u128
impl VecFromOtherType<u8> for u128
sourcefn vec_from_other_type(x: u8) -> Vec<Self>
fn vec_from_other_type(x: u8) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u8> for usize
impl VecFromOtherType<u8> for usize
sourcefn vec_from_other_type(x: u8) -> Vec<Self>
fn vec_from_other_type(x: u8) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u16> for u32
impl VecFromOtherType<u16> for u32
sourcefn vec_from_other_type(x: u16) -> Vec<Self>
fn vec_from_other_type(x: u16) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u16> for u64
impl VecFromOtherType<u16> for u64
sourcefn vec_from_other_type(x: u16) -> Vec<Self>
fn vec_from_other_type(x: u16) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u16> for u128
impl VecFromOtherType<u16> for u128
sourcefn vec_from_other_type(x: u16) -> Vec<Self>
fn vec_from_other_type(x: u16) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u16> for usize
impl VecFromOtherType<u16> for usize
sourcefn vec_from_other_type(x: u16) -> Vec<Self>
fn vec_from_other_type(x: u16) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u32> for u64
impl VecFromOtherType<u32> for u64
sourcefn vec_from_other_type(x: u32) -> Vec<Self>
fn vec_from_other_type(x: u32) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u32> for u128
impl VecFromOtherType<u32> for u128
sourcefn vec_from_other_type(x: u32) -> Vec<Self>
fn vec_from_other_type(x: u32) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u64> for u128
impl VecFromOtherType<u64> for u128
sourcefn vec_from_other_type(x: u64) -> Vec<Self>
fn vec_from_other_type(x: u64) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<usize> for u128
impl VecFromOtherType<usize> for u128
sourcefn vec_from_other_type(x: usize) -> Vec<Self>
fn vec_from_other_type(x: usize) -> Vec<Self>
Converts a value of one type of unsigned integer to a Vec
of a larger unsigned
type.
The output Vec
only contains one value. The least-significant bits of the
output value contain the input value, and the most-significant bits are set to 0.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl VecFromOtherType<u32> for usize
impl VecFromOtherType<u32> for usize
sourcefn vec_from_other_type(x: u32) -> Vec<Self>
fn vec_from_other_type(x: u32) -> Vec<Self>
Converts a u32
to a Vec
of usize
s.
Worst-case complexity
Constant time and additional memory.
See here.
sourceimpl VecFromOtherType<u64> for usize
impl VecFromOtherType<u64> for usize
sourcefn vec_from_other_type(x: u64) -> Vec<Self>
fn vec_from_other_type(x: u64) -> Vec<Self>
Converts a u64
to a Vec
of usize
s.
Worst-case complexity
Constant time and additional memory.
See here.
sourceimpl VecFromOtherType<usize> for u32
impl VecFromOtherType<usize> for u32
sourcefn vec_from_other_type(x: usize) -> Vec<Self>
fn vec_from_other_type(x: usize) -> Vec<Self>
Converts a usize
to a Vec
of u32
s.
Worst-case complexity
Constant time and additional memory.
See here.
sourceimpl VecFromOtherType<usize> for u64
impl VecFromOtherType<usize> for u64
sourcefn vec_from_other_type(x: usize) -> Vec<Self>
fn vec_from_other_type(x: usize) -> Vec<Self>
Converts a usize
to a Vec
of u64
s.
Worst-case complexity
Constant time and additional memory.
See here.