#[repr(C)]pub struct Word<T>(pub [T; 4]);
Expand description
An array of four bytes to represent a 32-bit value.
We use the generic type T
to represent the different representations of a byte, ranging from
a u8
to a AB::Var
or AB::Expr
.
Tuple Fields§
§0: [T; 4]
Implementations§
source§impl<T> Word<T>
impl<T> Word<T>
sourcepub fn map<F, S>(self, f: F) -> Word<S>where
F: FnMut(T) -> S,
pub fn map<F, S>(self, f: F) -> Word<S>where
F: FnMut(T) -> S,
Applies f
to each element of the word.
sourcepub fn extend_var<AB: SP1AirBuilder<Var = T>>(var: T) -> Word<AB::Expr>
pub fn extend_var<AB: SP1AirBuilder<Var = T>>(var: T) -> Word<AB::Expr>
Extends a variable to a word.
source§impl<T: AbstractField> Word<T>
impl<T: AbstractField> Word<T>
sourcepub fn extend_expr<AB: SP1AirBuilder<Expr = T>>(expr: T) -> Word<AB::Expr>
pub fn extend_expr<AB: SP1AirBuilder<Expr = T>>(expr: T) -> Word<AB::Expr>
Extends a variable to a word.
sourcepub fn zero<AB: SP1AirBuilder<Expr = T>>() -> Word<T>
pub fn zero<AB: SP1AirBuilder<Expr = T>>() -> Word<T>
Returns a word with all zero expressions.
Trait Implementations§
source§impl<T> BorrowMut<Word<T>> for [T]
impl<T> BorrowMut<Word<T>> for [T]
source§fn borrow_mut(&mut self) -> &mut Word<T>
fn borrow_mut(&mut self) -> &mut Word<T>
Mutably borrows from an owned value. Read more
source§impl<'de, T> Deserialize<'de> for Word<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Word<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: Clone> FromIterator<T> for Word<T>
impl<T: Clone> FromIterator<T> for Word<T>
source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
source§impl<T> IntoIterator for Word<T>
impl<T> IntoIterator for Word<T>
impl<T: Copy> Copy for Word<T>
impl<T: Eq> Eq for Word<T>
impl<T> StructuralPartialEq for Word<T>
Auto Trait Implementations§
impl<T> Freeze for Word<T>where
T: Freeze,
impl<T> RefUnwindSafe for Word<T>where
T: RefUnwindSafe,
impl<T> Send for Word<T>where
T: Send,
impl<T> Sync for Word<T>where
T: Sync,
impl<T> Unpin for Word<T>where
T: Unpin,
impl<T> UnwindSafe for Word<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more