Type Alias SafeAddress

Source
pub type SafeAddress<F> = SafeType<F, 1, 160>;
Expand description

SafeType for Address.

Aliased Type§

struct SafeAddress<F> { /* private fields */ }

Implementations

Source§

impl<F: ScalarField, const BYTES_PER_ELE: usize, const TOTAL_BITS: usize> SafeType<F, BYTES_PER_ELE, TOTAL_BITS>

Source

pub const BYTES_PER_ELE: usize = BYTES_PER_ELE

Number of bytes of each element.

Source

pub const TOTAL_BITS: usize = TOTAL_BITS

Total bits of this type.

Source

pub const VALUE_LENGTH: usize

Number of elements of this type.

Source

pub fn bits_per_ele() -> usize

Number of bits of each element.

Source

pub fn value(&self) -> &[AssignedValue<F>]

Return values in little-endian.

Trait Implementations

Source§

impl<F: ScalarField, const BYTES_PER_ELE: usize, const TOTAL_BITS: usize> AsRef<[AssignedValue<F>]> for SafeType<F, BYTES_PER_ELE, TOTAL_BITS>

Source§

fn as_ref(&self) -> &[AssignedValue<F>]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<F: Clone + ScalarField, const BYTES_PER_ELE: usize, const TOTAL_BITS: usize> Clone for SafeType<F, BYTES_PER_ELE, TOTAL_BITS>

Source§

fn clone(&self) -> SafeType<F, BYTES_PER_ELE, TOTAL_BITS>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: Debug + ScalarField, const BYTES_PER_ELE: usize, const TOTAL_BITS: usize> Debug for SafeType<F, BYTES_PER_ELE, TOTAL_BITS>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: ScalarField, const TOTAL_BITS: usize> TryFrom<Vec<SafeByte<F>>> for SafeType<F, 1, TOTAL_BITS>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<SafeByte<F>>) -> Result<Self, Self::Error>

Performs the conversion.