Struct parity_codec::Compact [−][src]
pub struct Compact<T>(pub T);
Compact-encoded variant of T. This is more space-efficient but less compute-efficient.
Trait Implementations
impl<T> From<T> for Compact<T>
[src]
impl<T> From<T> for Compact<T>
impl<'a, T: Copy> From<&'a T> for Compact<T>
[src]
impl<'a, T: Copy> From<&'a T> for Compact<T>
impl From<Compact<u8>> for u8
[src]
impl From<Compact<u8>> for u8
impl From<Compact<u16>> for u16
[src]
impl From<Compact<u16>> for u16
impl From<Compact<u32>> for u32
[src]
impl From<Compact<u32>> for u32
impl From<Compact<u64>> for u64
[src]
impl From<Compact<u64>> for u64
impl From<Compact<u128>> for u128
[src]
impl From<Compact<u128>> for u128
impl Encode for Compact<u8>
[src]
impl Encode for Compact<u8>
fn encode_to<W: Output>(&self, dest: &mut W)
[src]
fn encode_to<W: Output>(&self, dest: &mut W)
Convert self to a slice and append it to the destination.
fn encode(&self) -> Vec<u8>
[src]
fn encode(&self) -> Vec<u8>
Convert self to an owned vector.
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
[src]
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
impl Encode for Compact<u16>
[src]
impl Encode for Compact<u16>
fn encode_to<W: Output>(&self, dest: &mut W)
[src]
fn encode_to<W: Output>(&self, dest: &mut W)
Convert self to a slice and append it to the destination.
fn encode(&self) -> Vec<u8>
[src]
fn encode(&self) -> Vec<u8>
Convert self to an owned vector.
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
[src]
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
impl Encode for Compact<u32>
[src]
impl Encode for Compact<u32>
fn encode_to<W: Output>(&self, dest: &mut W)
[src]
fn encode_to<W: Output>(&self, dest: &mut W)
Convert self to a slice and append it to the destination.
fn encode(&self) -> Vec<u8>
[src]
fn encode(&self) -> Vec<u8>
Convert self to an owned vector.
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
[src]
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
impl Encode for Compact<u64>
[src]
impl Encode for Compact<u64>
fn encode_to<W: Output>(&self, dest: &mut W)
[src]
fn encode_to<W: Output>(&self, dest: &mut W)
Convert self to a slice and append it to the destination.
fn encode(&self) -> Vec<u8>
[src]
fn encode(&self) -> Vec<u8>
Convert self to an owned vector.
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
[src]
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
impl Encode for Compact<u128>
[src]
impl Encode for Compact<u128>
fn encode_to<W: Output>(&self, dest: &mut W)
[src]
fn encode_to<W: Output>(&self, dest: &mut W)
Convert self to a slice and append it to the destination.
fn encode(&self) -> Vec<u8>
[src]
fn encode(&self) -> Vec<u8>
Convert self to an owned vector.
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
[src]
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
impl Decode for Compact<u8>
[src]
impl Decode for Compact<u8>
impl Decode for Compact<u16>
[src]
impl Decode for Compact<u16>
impl Decode for Compact<u32>
[src]
impl Decode for Compact<u32>
impl Decode for Compact<u64>
[src]
impl Decode for Compact<u64>
impl Decode for Compact<u128>
[src]
impl Decode for Compact<u128>