Struct monero::consensus::encode::VarInt [−][src]
pub struct VarInt(pub u64);
A variable-length unsigned integer type as defined by the Monero codebase.
Methods from Deref<Target = u64>
pub const MIN: u64
1.43.0[src]
pub const MAX: u64
1.43.0[src]
pub const BITS: u32
1.53.0[src]
pub fn as_ne_bytes(&self) -> &[u8; 8]
[src]
🔬 This is a nightly-only experimental API. (
num_as_ne_bytes
)Return the memory representation of this integer as a byte array in native byte order.
to_ne_bytes
should be preferred over this whenever possible.
Examples
#![feature(num_as_ne_bytes)] let num = 0x1234567890123456u64; let bytes = num.as_ne_bytes(); assert_eq!( bytes, if cfg!(target_endian = "big") { &[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56] } else { &[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12] } );
Trait Implementations
impl<'de> Deserialize<'de> for VarInt
[src]
impl<'de> Deserialize<'de> for VarInt
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialOrd<VarInt> for VarInt
[src]
impl PartialOrd<VarInt> for VarInt
[src]impl StructuralEq for VarInt
[src]
impl StructuralEq for VarInt
[src]impl StructuralPartialEq for VarInt
[src]
impl StructuralPartialEq for VarInt
[src]Auto Trait Implementations
impl RefUnwindSafe for VarInt
impl RefUnwindSafe for VarInt
impl UnwindSafe for VarInt
impl UnwindSafe for VarInt