Struct bigint::M256
[−]
[src]
pub struct M256(pub U256);
Represent an unsigned modulo 256-bit integer
Methods
impl M256
[src]
fn zero() -> M256
[src]
Zero value of M256,
fn one() -> M256
[src]
One value of M256,
fn max_value() -> M256
[src]
Maximum value of M256,
fn min_value() -> M256
[src]
Minimum value of M256,
fn bits(self) -> usize
[src]
Bits required to represent this value.
fn log2floor(self) -> usize
[src]
Equals floor(log2(*))
. This is always an integer.
fn as_u32(&self) -> u32
[src]
fn as_u64(&self) -> u64
[src]
fn as_usize(&self) -> usize
[src]
Conversion to usize with overflow checking
Panics
Panics if the number is larger than usize::max_value().
fn byte(&self, index: usize) -> u8
[src]
fn index(&self, index: usize) -> u8
[src]
Return specific byte in big-endian format.
Panics
Panics if index
exceeds the byte width of the number.
Trait Implementations
impl Eq for M256
[src]
impl PartialEq for M256
[src]
fn eq(&self, __arg_0: &M256) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &M256) -> bool
[src]
This method tests for !=
.
impl Debug for M256
[src]
impl Copy for M256
[src]
impl Clone for M256
[src]
fn clone(&self) -> M256
[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 Hash for M256
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for M256
[src]
impl FromStr for M256
[src]
type Err = ParseHexError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<M256, ParseHexError>
[src]
Parses a string s
to return a value of this type. Read more
impl Encodable for M256
[src]
fn rlp_append(&self, s: &mut RlpStream)
[src]
Append a value to the stream
fn rlp_bytes(&self) -> ElasticArray1024<u8>
[src]
Get rlp-encoded bytes for this instance
impl Decodable for M256
[src]
fn decode(rlp: &UntrustedRlp) -> Result<Self, DecoderError>
[src]
Decode a value from RLP bytes
impl From<u64> for M256
[src]
impl Into<u64> for M256
[src]
impl From<usize> for M256
[src]
impl<'a> From<&'a [u8]> for M256
[src]
impl From<bool> for M256
[src]
impl From<U256> for M256
[src]
impl Into<U256> for M256
[src]
impl From<U512> for M256
[src]
impl Into<U512> for M256
[src]
impl From<i32> for M256
[src]
impl From<H256> for M256
[src]
impl From<H160> for M256
[src]
impl Ord for M256
[src]
fn cmp(&self, other: &M256) -> 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 PartialOrd for M256
[src]
fn partial_cmp(&self, other: &M256) -> 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 BitAnd<M256> for M256
[src]
type Output = M256
The resulting type after applying the &
operator.
fn bitand(self, other: M256) -> M256
[src]
Performs the &
operation.
impl BitOr<M256> for M256
[src]
type Output = M256
The resulting type after applying the |
operator.
fn bitor(self, other: M256) -> M256
[src]
Performs the |
operation.
impl BitXor<M256> for M256
[src]
type Output = M256
The resulting type after applying the ^
operator.
fn bitxor(self, other: M256) -> M256
[src]
Performs the ^
operation.
impl Shl<usize> for M256
[src]
type Output = M256
The resulting type after applying the <<
operator.
fn shl(self, shift: usize) -> M256
[src]
Performs the <<
operation.
impl Shr<usize> for M256
[src]
type Output = M256
The resulting type after applying the >>
operator.
fn shr(self, shift: usize) -> M256
[src]
Performs the >>
operation.
impl Add<M256> for M256
[src]
type Output = M256
The resulting type after applying the +
operator.
fn add(self, other: M256) -> M256
[src]
Performs the +
operation.
impl Sub<M256> for M256
[src]
type Output = M256
The resulting type after applying the -
operator.
fn sub(self, other: M256) -> M256
[src]
Performs the -
operation.
impl Mul<M256> for M256
[src]
type Output = M256
The resulting type after applying the *
operator.
fn mul(self, other: M256) -> M256
[src]
Performs the *
operation.
impl Div for M256
[src]
type Output = M256
The resulting type after applying the /
operator.
fn div(self, other: M256) -> M256
[src]
Performs the /
operation.
impl Rem for M256
[src]
type Output = M256
The resulting type after applying the %
operator.
fn rem(self, other: M256) -> M256
[src]
Performs the %
operation.
impl Not for M256
[src]
type Output = M256
The resulting type after applying the !
operator.
fn not(self) -> M256
[src]
Performs the unary !
operation.