[][src]Struct parity_codec::Compact

pub struct Compact<T>(pub T);

Compact-encoded variant of T. This is more space-efficient but less compute-efficient.

Trait Implementations

impl<T> Encode for Compact<T> where
    T: CompactAs,
    CompactRef<'a, <T as CompactAs>::As>: Encode
[src]

Important traits for Vec<u8>
fn encode(&self) -> Vec<u8>[src]

Convert self to an owned vector.

fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R[src]

Convert self to a slice and then invoke the given closure with it.

impl Encode for Compact<()>[src]

fn encode_to<T: Output>(&self, dest: &mut T)[src]

Convert self to a slice and append it to the destination.

Important traits for Vec<u8>
fn encode(&self) -> Vec<u8>[src]

Convert self to an owned vector.

impl Encode for Compact<u8>[src]

Important traits for Vec<u8>
fn encode(&self) -> Vec<u8>[src]

Convert self to an owned vector.

impl Encode for Compact<u16>[src]

Important traits for Vec<u8>
fn encode(&self) -> Vec<u8>[src]

Convert self to an owned vector.

impl Encode for Compact<u32>[src]

Important traits for Vec<u8>
fn encode(&self) -> Vec<u8>[src]

Convert self to an owned vector.

impl Encode for Compact<u64>[src]

Important traits for Vec<u8>
fn encode(&self) -> Vec<u8>[src]

Convert self to an owned vector.

impl Encode for Compact<u128>[src]

Important traits for Vec<u8>
fn encode(&self) -> Vec<u8>[src]

Convert self to an owned vector.

impl<T> Decode for Compact<T> where
    T: CompactAs,
    Compact<<T as CompactAs>::As>: Decode
[src]

impl Decode for Compact<()>[src]

impl Decode for Compact<u8>[src]

impl Decode for Compact<u16>[src]

impl Decode for Compact<u32>[src]

impl Decode for Compact<u64>[src]

impl Decode for Compact<u128>[src]

impl<'a, T: 'a> EncodeAsRef<'a, T> for Compact<T> where
    CompactRef<'a, T>: Encode + From<&'a T>, 
[src]

type RefType = CompactRef<'a, T>

The reference type that is used for encoding.

impl<T: Eq> Eq for Compact<T>[src]

impl<T: Copy> Copy for Compact<T>[src]

impl<T: PartialOrd> PartialOrd<Compact<T>> for Compact<T>[src]

impl<T: PartialEq> PartialEq<Compact<T>> for Compact<T>[src]

impl<T: Clone> Clone for Compact<T>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Ord> Ord for Compact<T>[src]

default fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

default fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

default fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<T> From<T> for Compact<T>[src]

impl<'a, T: Copy> From<&'a T> for Compact<T>[src]

impl From<Compact<()>> for ()[src]

impl From<Compact<u8>> for u8[src]

impl From<Compact<u16>> for u16[src]

impl From<Compact<u32>> for u32[src]

impl From<Compact<u64>> for u64[src]

impl From<Compact<u128>> for u128[src]

impl<T> Debug for Compact<T> where
    T: Debug
[src]

impl<T> Serialize for Compact<T> where
    T: Serialize
[src]

impl<'de, T> Deserialize<'de> for Compact<T> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T> Send for Compact<T> where
    T: Send

impl<T> Sync for Compact<T> where
    T: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]