Struct hacspec_lib::prelude::u16Word
source · [−]Expand description
Fixed length byte array.
Tuple Fields
0: [u8; 2]
Implementations
sourceimpl u16Word
impl u16Word
sourcepub fn new() -> Self
pub fn new() -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn length() -> usize
pub fn length() -> usize
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn from_array(v: [u8; 2]) -> Self
pub fn from_array(v: [u8; 2]) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn from_native_slice(v: &[u8]) -> Self
pub fn from_native_slice(v: &[u8]) -> Self
Function that is not part of the language but is offered as a helper for tests, etc.
sourceimpl u16Word
impl u16Word
sourcepub fn from_slice<A: SeqTrait<u8>>(input: &A, start: usize, len: usize) -> Self
pub fn from_slice<A: SeqTrait<u8>>(input: &A, start: usize, len: usize) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn concat<A: SeqTrait<u8>>(&self, next: &A) -> Seq<u8>
pub fn concat<A: SeqTrait<u8>>(&self, next: &A) -> Seq<u8>
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn from_slice_range<A: SeqTrait<u8>>(input: &A, r: Range<usize>) -> Self
pub fn from_slice_range<A: SeqTrait<u8>>(input: &A, r: Range<usize>) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn slice(&self, start_out: usize, len: usize) -> Seq<u8>
pub fn slice(&self, start_out: usize, len: usize) -> Seq<u8>
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn slice_range(&self, r: Range<usize>) -> Seq<u8>
pub fn slice_range(&self, r: Range<usize>) -> Seq<u8>
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn num_chunks(&self, chunk_size: usize) -> usize
pub fn num_chunks(&self, chunk_size: usize) -> usize
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn get_chunk_len(&self, chunk_size: usize, chunk_number: usize) -> usize
pub fn get_chunk_len(&self, chunk_size: usize, chunk_number: usize) -> usize
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourceimpl u16Word
impl u16Word
sourceimpl u16Word
impl u16Word
sourcepub fn into_le_bytes(self) -> Seq<u8>
pub fn into_le_bytes(self) -> Seq<u8>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourceimpl u16Word
impl u16Word
sourcepub fn to_be_u32s(&self) -> Seq<u32>
pub fn to_be_u32s(&self) -> Seq<u32>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_le_u32s(&self) -> Seq<u32>
pub fn to_le_u32s(&self) -> Seq<u32>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_be_u64s(&self) -> Seq<u64>
pub fn to_be_u64s(&self) -> Seq<u64>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_le_u64s(&self) -> Seq<u64>
pub fn to_le_u64s(&self) -> Seq<u64>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_u128s_be(&self) -> Seq<u128>
pub fn to_u128s_be(&self) -> Seq<u128>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_u128s_le(&self) -> Seq<u128>
pub fn to_u128s_le(&self) -> Seq<u128>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
Trait Implementations
sourceimpl ModNumeric for u16Word
impl ModNumeric for u16Word
sourcefn sub_mod(self, rhs: Self, n: Self) -> Self
fn sub_mod(self, rhs: Self, n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
(self - rhs) % n
(coefficient-wise)
sourcefn add_mod(self, rhs: Self, n: Self) -> Self
fn add_mod(self, rhs: Self, n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
(self + rhs) % n
(coefficient-wise)
sourcefn mul_mod(self, rhs: Self, n: Self) -> Self
fn mul_mod(self, rhs: Self, n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
(self * rhs) % n
(coefficient-wise)
Note that the multiplication is wrapping.
sourcefn pow_mod(self, exp: Self, n: Self) -> Self
fn pow_mod(self, exp: Self, n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
(self ^ exp) % n
(coefficient-wise)
Note that the exponentiation is wrapping.
sourcefn modulo(self, n: Self) -> Self
fn modulo(self, n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self % n
(coefficient-wise)
sourcefn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
(coefficient-wise)
sourceimpl Numeric for u16Word
impl Numeric for u16Word
sourcefn max_val() -> Self
fn max_val() -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec. Return largest value that can be represented. Not Implemented
sourcefn wrap_add(self, rhs: Self) -> Self
fn wrap_add(self, rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self + rhs
(coefficient-wise and wrapping)
sourcefn wrap_sub(self, rhs: Self) -> Self
fn wrap_sub(self, rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self - rhs
(coefficient-wise and wrapping)
sourcefn wrap_mul(self, rhs: Self) -> Self
fn wrap_mul(self, rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self * rhs
(coefficient-wise and wrapping)
sourcefn wrap_div(self, rhs: Self) -> Self
fn wrap_div(self, rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self + rhs
(coefficient-wise and wrapping)
sourcefn exp(self, exp: u32) -> Self
fn exp(self, exp: u32) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self ^ exp
where exp
is a u32
(coefficient-wise and wrapping).
sourcefn pow_self(self, _exp: Self) -> Self
fn pow_self(self, _exp: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec. Not implemented.
sourcefn divide(self, rhs: Self) -> Self
fn divide(self, rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self / rhs
(coefficient-wise and wrapping).
sourcefn inv(self, _n: Self) -> Self
fn inv(self, _n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec. Not implemented
sourcefn equal(self, _other: Self) -> bool
fn equal(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn greater_than(self, _other: Self) -> bool
fn greater_than(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn greater_than_or_equal(self, _other: Self) -> bool
fn greater_than_or_equal(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn less_than(self, _other: Self) -> bool
fn less_than(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn less_than_or_equal(self, _other: Self) -> bool
fn less_than_or_equal(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn not_equal_bm(self, _other: Self) -> Self
fn not_equal_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn equal_bm(self, _other: Self) -> Self
fn equal_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn greater_than_bm(self, _other: Self) -> Self
fn greater_than_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn greater_than_or_equal_bm(self, _other: Self) -> Self
fn greater_than_or_equal_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn less_than_bm(self, _other: Self) -> Self
fn less_than_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn less_than_or_equal_bm(self, _other: Self) -> Self
fn less_than_or_equal_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourceimpl Ord for u16Word
impl Ord for u16Word
sourcefn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
sourceimpl PartialOrd<u16Word> for u16Word
impl PartialOrd<u16Word> for u16Word
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl SeqTrait<u8> for u16Word
impl SeqTrait<u8> for u16Word
sourcefn create(x: usize) -> Self
fn create(x: usize) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn len(&self) -> usize
fn len(&self) -> usize
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcefn iter(&self) -> Iter<'_, u8>
fn iter(&self) -> Iter<'_, u8>
Function that is not part of the language but is offered as a helper for tests, etc.
sourcefn update_slice<A: SeqTrait<u8>>(
self,
start_out: usize,
v: &A,
start_in: usize,
len: usize
) -> Self
fn update_slice<A: SeqTrait<u8>>(
self,
start_out: usize,
v: &A,
start_in: usize,
len: usize
) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn update<A: SeqTrait<u8>>(self, start: usize, v: &A) -> Self
fn update<A: SeqTrait<u8>>(self, start: usize, v: &A) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn update_start<A: SeqTrait<u8>>(self, v: &A) -> Self
fn update_start<A: SeqTrait<u8>>(self, v: &A) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
impl Copy for u16Word
impl Eq for u16Word
impl NumericCopy for u16Word
Auto Trait Implementations
impl RefUnwindSafe for u16Word
impl Send for u16Word
impl Sync for u16Word
impl Unpin for u16Word
impl UnwindSafe for u16Word
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more