Type Alias B128

Source
pub type B128 = Bits<128, 2>;
Expand description

Bits for 128 bits.

Aliased Type§

struct B128(/* private fields */);

Implementations

Source§

impl<const BITS: usize, const LIMBS: usize> Bits<BITS, LIMBS>

Source

pub fn reverse_bits(self) -> Self

See Uint::reverse_bits for documentation.

Source

pub fn as_le_bytes(&self) -> Cow<'_, [u8]>

See Uint::as_le_bytes for documentation.

Source

pub fn to_be_bytes_vec(&self) -> Vec<u8>

See Uint::to_be_bytes_vec for documentation.

Source

pub fn to_le_bytes<const BYTES: usize>(&self) -> [u8; BYTES]

See Uint::to_le_bytes for documentation.

Source

pub fn to_be_bytes<const BYTES: usize>(&self) -> [u8; BYTES]

See Uint::to_be_bytes for documentation.

Source

pub fn leading_zeros(&self) -> usize

See Uint::leading_zeros for documentation.

Source

pub fn leading_ones(&self) -> usize

See Uint::leading_ones for documentation.

Source

pub fn trailing_zeros(&self) -> usize

See Uint::trailing_zeros for documentation.

Source

pub fn trailing_ones(&self) -> usize

See Uint::trailing_ones for documentation.

Source

pub unsafe fn as_limbs_mut(&mut self) -> &mut [u64; LIMBS]

See Uint::as_limbs_mut for documentation.

Source

pub fn checked_shl(self, rhs: usize) -> Option<Self>

See Uint::checked_shl for documentation.

Source

pub fn checked_shr(self, rhs: usize) -> Option<Self>

See Uint::checked_shr for documentation.

Source

pub fn overflowing_shl(self, rhs: usize) -> (Self, bool)

See Uint::overflowing_shl for documentation.

Source

pub fn overflowing_shr(self, rhs: usize) -> (Self, bool)

See Uint::overflowing_shr for documentation.

Source

pub fn wrapping_shl(self, rhs: usize) -> Self

See Uint::wrapping_shl for documentation.

Source

pub fn wrapping_shr(self, rhs: usize) -> Self

See Uint::wrapping_shr for documentation.

Source

pub fn rotate_left(self, rhs: usize) -> Self

See Uint::rotate_left for documentation.

Source

pub fn rotate_right(self, rhs: usize) -> Self

See Uint::rotate_right for documentation.

Source

pub fn try_from_be_slice(bytes: &[u8]) -> Option<Self>

See Uint::try_from_be_slice for documentation.

Source

pub fn try_from_le_slice(bytes: &[u8]) -> Option<Self>

See Uint::try_from_le_slice for documentation.

Source

pub fn from_str_radix(src: &str, radix: u64) -> Result<Self, ParseError>

See Uint::from_str_radix for documentation.

Source

pub fn from_be_bytes<const BYTES: usize>(bytes: [u8; BYTES]) -> Self

See Uint::from_be_bytes for documentation.

Source

pub fn from_le_bytes<const BYTES: usize>(bytes: [u8; BYTES]) -> Self

See Uint::from_le_bytes for documentation.

Source

pub const fn from_limbs(limbs: [u64; LIMBS]) -> Self

See Uint::from_limbs for documentation.

Source

pub const fn as_limbs(&self) -> &[u64; LIMBS]

See Uint::as_limbs for documentation.

Source§

impl<const BITS: usize, const LIMBS: usize> Bits<BITS, LIMBS>

Source

pub const LIMBS: usize = Uint<BITS, LIMBS>::LIMBS

The size of this integer type in 64-bit limbs.

Source

pub const BITS: usize = Uint<BITS, LIMBS>::BITS

The size of this integer type in bits.

Source

pub const BYTES: usize = Uint<BITS, LIMBS>::BYTES

The size of this integer type in bits.

Source

pub const ZERO: Self

The value zero. This is the only value that exists in all Uint types.

Source

pub const fn into_inner(self) -> Uint<BITS, LIMBS>

Returns the inner Uint.

Source

pub const fn as_uint(&self) -> &Uint<BITS, LIMBS>

Returns a reference to the inner Uint.

Source

pub fn as_uint_mut(&mut self) -> &mut Uint<BITS, LIMBS>

Returns a mutable reference to the inner Uint.

Trait Implementations

Source§

impl<const BITS: usize, const LIMBS: usize> BitAnd<&Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Bits<BITS, LIMBS>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitAnd for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Bits<BITS, LIMBS>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitAndAssign<&Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>

Source§

fn bitand_assign(&mut self, rhs: &Bits<BITS, LIMBS>)

Performs the &= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitAndAssign for Bits<BITS, LIMBS>

Source§

fn bitand_assign(&mut self, rhs: Bits<BITS, LIMBS>)

Performs the &= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitOr<&Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Bits<BITS, LIMBS>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitOr for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Bits<BITS, LIMBS>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitOrAssign<&Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>

Source§

fn bitor_assign(&mut self, rhs: &Bits<BITS, LIMBS>)

Performs the |= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitOrAssign for Bits<BITS, LIMBS>

Source§

fn bitor_assign(&mut self, rhs: Bits<BITS, LIMBS>)

Performs the |= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitXor<&Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Bits<BITS, LIMBS>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitXor for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Bits<BITS, LIMBS>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitXorAssign<&Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>

Source§

fn bitxor_assign(&mut self, rhs: &Bits<BITS, LIMBS>)

Performs the ^= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> BitXorAssign for Bits<BITS, LIMBS>

Source§

fn bitxor_assign(&mut self, rhs: Bits<BITS, LIMBS>)

Performs the ^= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Clone for Bits<BITS, LIMBS>

Source§

fn clone(&self) -> Bits<BITS, LIMBS>

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<const BITS: usize, const LIMBS: usize> Debug for Bits<BITS, LIMBS>

Source§

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

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

impl<const BITS: usize, const LIMBS: usize> Default for Bits<BITS, LIMBS>

Source§

fn default() -> Bits<BITS, LIMBS>

Returns the “default value” for a type. Read more
Source§

impl<'de, const BITS: usize, const LIMBS: usize> Deserialize<'de> for Bits<BITS, LIMBS>

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> From<Uint<BITS, LIMBS>> for Bits<BITS, LIMBS>

Source§

fn from(value: Uint<BITS, LIMBS>) -> Self

Converts to this type from the input type.
Source§

impl<const BITS: usize, const LIMBS: usize> FromStr for Bits<BITS, LIMBS>

Source§

type Err = <Uint<BITS, LIMBS> as FromStr>::Err

The associated error which can be returned from parsing.
Source§

fn from_str(src: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Hash for Bits<BITS, LIMBS>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Index<usize> for Bits<BITS, LIMBS>

Source§

type Output = bool

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Not for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> PartialEq for Bits<BITS, LIMBS>

Source§

fn eq(&self, other: &Bits<BITS, LIMBS>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const BITS: usize, const LIMBS: usize> Serialize for Bits<BITS, LIMBS>

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Shl<&usize> for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &usize) -> Self

Performs the << operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Shl<usize> for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self

Performs the << operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> ShlAssign<&usize> for Bits<BITS, LIMBS>

Source§

fn shl_assign(&mut self, rhs: &usize)

Performs the <<= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> ShlAssign<usize> for Bits<BITS, LIMBS>

Source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Shr<&usize> for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &usize) -> Self

Performs the >> operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Shr<usize> for Bits<BITS, LIMBS>

Source§

type Output = Bits<BITS, LIMBS>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self

Performs the >> operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> ShrAssign<&usize> for Bits<BITS, LIMBS>

Source§

fn shr_assign(&mut self, rhs: &usize)

Performs the >>= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> ShrAssign<usize> for Bits<BITS, LIMBS>

Source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Copy for Bits<BITS, LIMBS>

Source§

impl<const BITS: usize, const LIMBS: usize> Eq for Bits<BITS, LIMBS>

Source§

impl<const BITS: usize, const LIMBS: usize> StructuralPartialEq for Bits<BITS, LIMBS>