Struct bitcoin::util::uint::Uint256
[−]
[src]
#[repr(C)]pub struct Uint256(pub [u64; 4]);
Little-endian large integer type
Methods
impl Uint256
[src]
fn as_ptr(&self) -> *const u64
[src]
Converts the object to a raw pointer
fn as_mut_ptr(&mut self) -> *mut u64
[src]
Converts the object to a mutable raw pointer
fn len(&self) -> usize
[src]
Returns the length of the object as an array
fn is_empty(&self) -> bool
[src]
Returns whether the object, as an array, is empty. Always false.
impl Uint256
[src]
fn low_u32(&self) -> u32
[src]
Conversion to u32
fn bits(&self) -> usize
[src]
Return the least number of bits needed to represent the number
fn mul_u32(self, other: u32) -> Uint256
[src]
Multiplication by u32
impl Uint256
[src]
Trait Implementations
impl<'a> From<&'a [u64]> for Uint256
[src]
impl Index<usize> for Uint256
[src]
type Output = u64
The returned type after indexing.
fn index(&self, index: usize) -> &u64
[src]
Performs the indexing (container[index]
) operation.
impl Index<Range<usize>> for Uint256
[src]
type Output = [u64]
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &[u64]
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeTo<usize>> for Uint256
[src]
type Output = [u64]
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &[u64]
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeFrom<usize>> for Uint256
[src]
type Output = [u64]
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &[u64]
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeFull> for Uint256
[src]
type Output = [u64]
The returned type after indexing.
fn index(&self, _: RangeFull) -> &[u64]
[src]
Performs the indexing (container[index]
) operation.
impl PartialEq for Uint256
[src]
fn eq(&self, other: &Uint256) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Uint256
[src]
impl PartialOrd for Uint256
[src]
fn partial_cmp(&self, other: &Uint256) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Uint256
[src]
fn cmp(&self, other: &Uint256) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Clone for Uint256
[src]
fn clone(&self) -> Uint256
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Uint256
[src]
impl Hash for Uint256
[src]
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Uint256], state: &mut H) where
H: Hasher,
[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Rand for Uint256
[src]
fn rand<R: Rng>(r: &mut R) -> Uint256
[src]
Generates a random instance of this type using the specified source of randomness. Read more
impl FromPrimitive for Uint256
[src]
fn from_u64(init: u64) -> Option<Uint256>
[src]
Convert an u64
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_i64(init: i64) -> Option<Uint256>
[src]
Convert an i64
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_isize(n: isize) -> Option<Self>
[src]
Convert an isize
to return an optional value of this type. If the value cannot be represented by this value, the None
is returned. Read more
fn from_i8(n: i8) -> Option<Self>
[src]
Convert an i8
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_i16(n: i16) -> Option<Self>
[src]
Convert an i16
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_i32(n: i32) -> Option<Self>
[src]
Convert an i32
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_usize(n: usize) -> Option<Self>
[src]
Convert a usize
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_u8(n: u8) -> Option<Self>
[src]
Convert an u8
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_u16(n: u16) -> Option<Self>
[src]
Convert an u16
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_u32(n: u32) -> Option<Self>
[src]
Convert an u32
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_f32(n: f32) -> Option<Self>
[src]
Convert a f32
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
fn from_f64(n: f64) -> Option<Self>
[src]
Convert a f64
to return an optional value of this type. If the type cannot be represented by this value, the None
is returned. Read more
impl Zero for Uint256
[src]
fn zero() -> Uint256
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl One for Uint256
[src]
impl Add<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the +
operator.
fn add(self, other: Uint256) -> Uint256
[src]
Performs the +
operation.
impl Sub<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the -
operator.
fn sub(self, other: Uint256) -> Uint256
[src]
Performs the -
operation.
impl Mul<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the *
operator.
fn mul(self, other: Uint256) -> Uint256
[src]
Performs the *
operation.
impl Div<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the /
operator.
fn div(self, other: Uint256) -> Uint256
[src]
Performs the /
operation.
impl BitArray for Uint256
[src]
fn bit(&self, index: usize) -> bool
[src]
Is bit set?
fn bit_slice(&self, start: usize, end: usize) -> Uint256
[src]
Returns an array which is just the bits from start to end
fn mask(&self, n: usize) -> Uint256
[src]
Bitwise and with n
ones
fn trailing_zeros(&self) -> usize
[src]
Trailing zeros
impl BitAnd<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the &
operator.
fn bitand(self, other: Uint256) -> Uint256
[src]
Performs the &
operation.
impl BitXor<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the ^
operator.
fn bitxor(self, other: Uint256) -> Uint256
[src]
Performs the ^
operation.
impl BitOr<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the |
operator.
fn bitor(self, other: Uint256) -> Uint256
[src]
Performs the |
operation.
impl Not for Uint256
[src]
type Output = Uint256
The resulting type after applying the !
operator.
fn not(self) -> Uint256
[src]
Performs the unary !
operation.
impl Shl<usize> for Uint256
[src]
type Output = Uint256
The resulting type after applying the <<
operator.
fn shl(self, shift: usize) -> Uint256
[src]
Performs the <<
operation.
impl Shr<usize> for Uint256
[src]
type Output = Uint256
The resulting type after applying the >>
operator.
fn shr(self, shift: usize) -> Uint256
[src]
Performs the >>
operation.
impl Debug for Uint256
[src]
impl<S: SimpleEncoder> ConsensusEncodable<S> for Uint256
[src]
fn consensus_encode(&self, s: &mut S) -> Result<(), S::Error>
[src]
Encode an object with a well-defined format