Struct hacspec_lib::seq::PublicSeq
source · [−]pub struct PublicSeq<T: Default + PublicInteger> { /* private fields */ }
Expand description
Variable length byte arrays.
Implementations
sourceimpl PublicSeq<u8>
impl PublicSeq<u8>
sourcepub fn from_public_slice(v: &[u8]) -> PublicSeq<u8>
pub fn from_public_slice(v: &[u8]) -> PublicSeq<u8>
Function that is not part of the language but is offered as a helper for tests, etc.
sourcepub fn from_native(b: Vec<u8>) -> PublicSeq<u8>
pub fn from_native(b: Vec<u8>) -> PublicSeq<u8>
Function that is not part of the language but is offered as a helper for tests, etc.
sourcepub fn to_native(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn to_native(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Function that is not part of the language but is offered as a helper for tests, etc.
sourceimpl<T: Clone + Default + PublicInteger> PublicSeq<T>
impl<T: Clone + Default + PublicInteger> PublicSeq<T>
sourcepub fn new(l: usize) -> Self
pub fn new(l: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn with_capacity(l: usize) -> Self
pub fn with_capacity(l: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn reserve(self, additional: usize) -> Self
pub fn reserve(self, additional: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec Get the size of this sequence.
sourcepub fn slice(&self, start_out: usize, len: usize) -> Self
pub fn slice(&self, start_out: 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 native_slice(&self) -> &[T]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
pub fn native_slice(&self) -> &[T]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Function that is not part of the language but is offered as a helper for tests, etc.
sourcepub fn into_slice(self, start_out: usize, len: usize) -> Self
pub fn into_slice(self, start_out: usize, len: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn slice_range(&self, r: Range<usize>) -> Self
pub fn slice_range(&self, 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 into_slice_range(self, r: Range<usize>) -> Self
pub fn into_slice_range(self, r: Range<usize>) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn split_off(self, at: usize) -> (Self, Self)
pub fn split_off(self, at: usize) -> (Self, Self)
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn pop(self) -> (T, Self)
pub fn pop(self) -> (T, Self)
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn truncate(self, len: usize) -> Self
pub fn truncate(self, len: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn from_slice<A: SeqTrait<T>>(input: &A, start: usize, len: usize) -> Self
pub fn from_slice<A: SeqTrait<T>>(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<T>>(&self, next: &A) -> Self
pub fn concat<A: SeqTrait<T>>(&self, next: &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.
sourcepub fn concat_owned(self, next: Self) -> Self
pub fn concat_owned(self, next: 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.
sourcepub fn push(&self, next: &T) -> Self
pub fn push(&self, next: &T) -> 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 push_owned(self, next: T) -> Self
pub fn push_owned(self, next: T) -> 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 from_slice_range<A: SeqTrait<T>>(input: &A, r: Range<usize>) -> Self
pub fn from_slice_range<A: SeqTrait<T>>(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 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 num_exact_chunks(&self, chunk_size: usize) -> usize
pub fn num_exact_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.
Get the number of chunks of chunk_size
in this array.
There might be less than chunk_size
remaining elements in this
array beyond these.
sourcepub fn get_chunk(&self, chunk_size: usize, chunk_number: usize) -> (usize, Self)
pub fn get_chunk(&self, chunk_size: usize, chunk_number: usize) -> (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 get_exact_chunk(&self, chunk_size: usize, chunk_number: usize) -> Self
pub fn get_exact_chunk(&self, chunk_size: usize, chunk_number: 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.
Get the chunk_number
chunk of chunk_size
from this array
as Seq<T>
.
The resulting sequence is of exactly chunk_size
length.
Until #84 is fixed this returns an empty sequence if not enough
elements are left.
sourcepub fn get_remainder_chunk(&self, chunk_size: usize) -> Self
pub fn get_remainder_chunk(&self, chunk_size: 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.
Get the remaining chunk of this array of length less than
chunk_size
.
If there’s no remainder, i.e. if the length of this array can
be divided by chunk_size
without a remainder, the function
returns an empty sequence (until #84 is fixed).
sourcepub fn set_chunk<A: SeqTrait<T>>(
self,
chunk_size: usize,
chunk_number: usize,
input: &A
) -> Self
pub fn set_chunk<A: SeqTrait<T>>(
self,
chunk_size: usize,
chunk_number: usize,
input: &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.
sourcepub fn set_exact_chunk<A: SeqTrait<T>>(
self,
chunk_size: usize,
chunk_number: usize,
input: &A
) -> Self
pub fn set_exact_chunk<A: SeqTrait<T>>(
self,
chunk_size: usize,
chunk_number: usize,
input: &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.
sourcepub fn update_owned(self, start_out: usize, v: Self) -> Self
pub fn update_owned(self, start_out: usize, v: 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<T: Clone + Default + PublicInteger> PublicSeq<T>
impl<T: Clone + Default + PublicInteger> PublicSeq<T>
sourceimpl PublicSeq<u8>
impl PublicSeq<u8>
sourcepub fn from_hex(s: &str) -> PublicSeq<u8>
pub fn from_hex(s: &str) -> PublicSeq<u8>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn from_string(s: String) -> PublicSeq<u8>
pub fn from_string(s: String) -> PublicSeq<u8>
Function that is not part of the language but is offered as a helper for tests, etc.
Trait Implementations
sourceimpl<T: Numeric + PublicInteger + Copy> Add<PublicSeq<T>> for PublicSeq<T>
impl<T: Numeric + PublicInteger + Copy> Add<PublicSeq<T>> for PublicSeq<T>
Polynomial addition on ℤ[x]
sourceimpl<T: Numeric + PublicInteger + Copy> ModNumeric for PublicSeq<T>
impl<T: Numeric + PublicInteger + Copy> ModNumeric for PublicSeq<T>
sourcefn absolute(self) -> Self
fn absolute(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|
(coefficient-wise)
sourcefn signed_modulo(self, _n: Self) -> Self
fn signed_modulo(self, _n: Self) -> Self
self % n
that always returns a positive integer
sourceimpl<T: Numeric + PublicInteger + Copy> Mul<PublicSeq<T>> for PublicSeq<T>
impl<T: Numeric + PublicInteger + Copy> Mul<PublicSeq<T>> for PublicSeq<T>
Polynomial multiplication on ℤ[x]
sourceimpl<T: Numeric + PublicInteger + Copy> Numeric for PublicSeq<T>
impl<T: Numeric + PublicInteger + Copy> Numeric for PublicSeq<T>
fn wrap_add(self, rhs: Self) -> Self
fn wrap_sub(self, rhs: Self) -> Self
fn wrap_mul(self, rhs: Self) -> Self
fn wrap_div(self, rhs: Self) -> Self
fn equal(self, other: Self) -> bool
fn greater_than(self, other: Self) -> bool
fn greater_than_or_equal(self, other: Self) -> bool
fn less_than(self, other: Self) -> bool
fn less_than_or_equal(self, other: Self) -> bool
fn not_equal_bm(self, other: Self) -> Self
fn equal_bm(self, other: Self) -> Self
fn greater_than_bm(self, other: Self) -> Self
fn greater_than_or_equal_bm(self, other: Self) -> Self
fn less_than_bm(self, other: Self) -> Self
fn less_than_or_equal_bm(self, other: Self) -> Self
sourceimpl<T: Clone + Default + PublicInteger> SeqTrait<T> for PublicSeq<T>
impl<T: Clone + Default + PublicInteger> SeqTrait<T> for PublicSeq<T>
sourcefn create(l: usize) -> Self
fn create(l: 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.
Get a new sequence of capacity l
.
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<'_, T>
fn iter(&self) -> Iter<'_, T>
Function that is not part of the language but is offered as a helper for tests, etc.
sourcefn update_slice<A: SeqTrait<T>>(
self,
start_out: usize,
v: &A,
start_in: usize,
len: usize
) -> Self
fn update_slice<A: SeqTrait<T>>(
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<T>>(self, start: usize, v: &A) -> Self
fn update<A: SeqTrait<T>>(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<T>>(self, v: &A) -> Self
fn update_start<A: SeqTrait<T>>(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.
sourceimpl<T: Numeric + PublicInteger + Copy> Sub<PublicSeq<T>> for PublicSeq<T>
impl<T: Numeric + PublicInteger + Copy> Sub<PublicSeq<T>> for PublicSeq<T>
Polynomial subtraction on ℤ[x]
impl<T: Copy + Default + PartialEq + PublicInteger> Eq for PublicSeq<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for PublicSeq<T> where
T: RefUnwindSafe,
impl<T> Send for PublicSeq<T> where
T: Send,
impl<T> Sync for PublicSeq<T> where
T: Sync,
impl<T> Unpin for PublicSeq<T> where
T: Unpin,
impl<T> UnwindSafe for PublicSeq<T> where
T: UnwindSafe,
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