Struct bitcoin::network::encodable::VarInt [−][src]
pub struct VarInt(pub u64);
A variable-length unsigned integer
Methods
impl VarInt
[src]
impl VarInt
pub fn encoded_length(&self) -> u64
[src]
pub fn encoded_length(&self) -> u64
Gets the length of this VarInt when encoded. Returns 1 for 0...0xFC, 3 for 0xFD...(2^16-1), 5 for 0x10000...(2^32-1), and 9 otherwise.
Trait Implementations
impl PartialEq for VarInt
[src]
impl PartialEq for VarInt
fn eq(&self, other: &VarInt) -> bool
[src]
fn eq(&self, other: &VarInt) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &VarInt) -> bool
[src]
fn ne(&self, other: &VarInt) -> bool
This method tests for !=
.
impl Eq for VarInt
[src]
impl Eq for VarInt
impl PartialOrd for VarInt
[src]
impl PartialOrd for VarInt
fn partial_cmp(&self, other: &VarInt) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &VarInt) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &VarInt) -> bool
[src]
fn lt(&self, other: &VarInt) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &VarInt) -> bool
[src]
fn le(&self, other: &VarInt) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &VarInt) -> bool
[src]
fn gt(&self, other: &VarInt) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &VarInt) -> bool
[src]
fn ge(&self, other: &VarInt) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for VarInt
[src]
impl Ord for VarInt
fn cmp(&self, other: &VarInt) -> Ordering
[src]
fn cmp(&self, other: &VarInt) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Clone for VarInt
[src]
impl Clone for VarInt
fn clone(&self) -> VarInt
[src]
fn clone(&self) -> VarInt
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for VarInt
[src]
impl Debug for VarInt
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: SimpleEncoder> ConsensusEncodable<S> for VarInt
[src]
impl<S: SimpleEncoder> ConsensusEncodable<S> for VarInt
fn consensus_encode(&self, s: &mut S) -> Result<(), Error>
[src]
fn consensus_encode(&self, s: &mut S) -> Result<(), Error>
Encode an object with a well-defined format
impl<D: SimpleDecoder> ConsensusDecodable<D> for VarInt
[src]
impl<D: SimpleDecoder> ConsensusDecodable<D> for VarInt