Struct bitcoin::util::uint::Uint256
[−]
[src]
pub struct Uint256(pub [u64; 4]);
Little-endian large integer type
Methods
impl Uint256
[src]
fn as_ptr(&self) -> *const u64
Converts the object to a raw pointer
fn as_mut_ptr(&mut self) -> *mut u64
Converts the object to a mutable raw pointer
fn len(&self) -> usize
Returns the length of the object as an array
fn is_empty(&self) -> bool
Returns whether the object, as an array, is empty. Always false.
impl Uint256
[src]
fn low_u32(&self) -> u32
Conversion to u32
fn bits(&self) -> usize
Return the least number of bits needed to represent the number
fn mul_u32(self, other: u32) -> Uint256
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
The method for the indexing (Foo[Bar]
) operation
impl Index<Range<usize>> for Uint256
[src]
type Output = [u64]
The returned type after indexing
fn index(&self, index: Range<usize>) -> &[u64]
The method for the indexing (Foo[Bar]
) operation
impl Index<RangeTo<usize>> for Uint256
[src]
type Output = [u64]
The returned type after indexing
fn index(&self, index: RangeTo<usize>) -> &[u64]
The method for the indexing (Foo[Bar]
) operation
impl Index<RangeFrom<usize>> for Uint256
[src]
type Output = [u64]
The returned type after indexing
fn index(&self, index: RangeFrom<usize>) -> &[u64]
The method for the indexing (Foo[Bar]
) operation
impl Index<RangeFull> for Uint256
[src]
type Output = [u64]
The returned type after indexing
fn index(&self, _: RangeFull) -> &[u64]
The method for the indexing (Foo[Bar]
) operation
impl PartialEq for Uint256
[src]
fn eq(&self, other: &Uint256) -> bool
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
This method tests for !=
.
impl Eq for Uint256
[src]
impl PartialOrd for Uint256
[src]
fn partial_cmp(&self, other: &Uint256) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
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
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
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
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
This method returns an Ordering
between self
and other
. Read more
impl Clone for Uint256
[src]
fn clone(&self) -> Uint256
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
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
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Uint256], state: &mut H) where H: Hasher
Feeds a slice of this type into the state provided.
impl Rand for Uint256
[src]
fn rand<R: Rng>(r: &mut R) -> Uint256
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
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
The method for the +
operator
impl Sub<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the -
operator
fn sub(self, other: Uint256) -> Uint256
The method for the -
operator
impl Mul<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the *
operator
fn mul(self, other: Uint256) -> Uint256
The method for the *
operator
impl Div<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the /
operator
fn div(self, other: Uint256) -> Uint256
The method for the /
operator
impl BitArray for Uint256
[src]
fn bit(&self, index: usize) -> bool
Is bit set?
fn bit_slice(&self, start: usize, end: usize) -> Uint256
Returns an array which is just the bits from start to end
fn mask(&self, n: usize) -> Uint256
Bitwise and with n
ones
fn trailing_zeros(&self) -> usize
Trailing zeros
impl BitAnd<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the &
operator
fn bitand(self, other: Uint256) -> Uint256
The method for the &
operator
impl BitXor<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the ^
operator
fn bitxor(self, other: Uint256) -> Uint256
The method for the ^
operator
impl BitOr<Uint256> for Uint256
[src]
type Output = Uint256
The resulting type after applying the |
operator
fn bitor(self, other: Uint256) -> Uint256
The method for the |
operator
impl Not for Uint256
[src]
type Output = Uint256
The resulting type after applying the !
operator
fn not(self) -> Uint256
The method for the unary !
operator
impl Shl<usize> for Uint256
[src]
type Output = Uint256
The resulting type after applying the <<
operator
fn shl(self, shift: usize) -> Uint256
The method for the <<
operator
impl Shr<usize> for Uint256
[src]
type Output = Uint256
The resulting type after applying the >>
operator
fn shr(self, shift: usize) -> Uint256
The method for the >>
operator
impl Debug for Uint256
[src]
impl<S: SimpleEncoder> ConsensusEncodable<S> for Uint256
[src]
fn consensus_encode(&self, s: &mut S) -> Result<(), S::Error>
Encode an object with a well-defined format
impl<D: SimpleDecoder> ConsensusDecodable<D> for Uint256
[src]
fn consensus_decode(d: &mut D) -> Result<Uint256, D::Error>
Decode an object with a well-defined format