pub struct SecretSeq<T: Default + SecretInteger> { /* private fields */ }
Expand description
Variable length byte arrays.
Implementations§
Source§impl<T: Clone + Default + SecretInteger> SecretSeq<T>
impl<T: Clone + Default + SecretInteger> SecretSeq<T>
pub fn new(l: usize) -> Self
pub fn with_capacity(l: usize) -> Self
pub fn reserve(self, additional: usize) -> Self
pub fn slice(&self, start_out: usize, len: usize) -> Self
pub fn native_slice(&self) -> &[T]
pub fn into_slice(self, start_out: usize, len: usize) -> Self
pub fn slice_range(&self, r: Range<usize>) -> Self
pub fn into_slice_range(self, r: Range<usize>) -> Self
pub fn split_off(self, at: usize) -> (Self, Self)
pub fn pop(self) -> (T, Self)
pub fn truncate(self, len: usize) -> Self
pub fn from_slice<A: SeqTrait<T>>(input: &A, start: usize, len: usize) -> Self
pub fn concat<A: SeqTrait<T>>(&self, next: &A) -> Self
pub fn concat_owned(self, next: Self) -> Self
pub fn push(&self, next: &T) -> Self
pub fn push_owned(self, next: T) -> Self
pub fn from_slice_range<A: SeqTrait<T>>(input: &A, r: Range<usize>) -> Self
pub fn num_chunks(&self, chunk_size: usize) -> usize
Sourcepub fn num_exact_chunks(&self, chunk_size: usize) -> usize
pub fn num_exact_chunks(&self, chunk_size: usize) -> usize
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.
pub fn get_chunk(&self, chunk_size: usize, chunk_number: usize) -> (usize, Self)
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
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
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).
pub fn set_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
pub fn update_owned(self, start_out: usize, v: Self) -> Self
Trait Implementations§
Source§impl<T: Clone + Default + SecretInteger> SeqTrait<T> for SecretSeq<T>
impl<T: Clone + Default + SecretInteger> SeqTrait<T> for SecretSeq<T>
fn len(&self) -> usize
fn iter(&self) -> Iter<'_, T>
Source§fn 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
fn update_start<A: SeqTrait<T>>(self, v: &A) -> Self
Auto Trait Implementations§
impl<T> Freeze for SecretSeq<T>
impl<T> RefUnwindSafe for SecretSeq<T>where
T: RefUnwindSafe,
impl<T> Send for SecretSeq<T>where
T: Send,
impl<T> Sync for SecretSeq<T>where
T: Sync,
impl<T> Unpin for SecretSeq<T>where
T: Unpin,
impl<T> UnwindSafe for SecretSeq<T>where
T: UnwindSafe,
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