Trait DecodeLength

Source
pub trait DecodeLength {
    // Required method
    fn len(self_encoded: &[u8]) -> Result<usize, Error>;
}
Expand description

Trait that allows the length of a collection to be read, without having to read and decode the entire elements.

Required Methods§

Source

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Return the number of elements in self_encoded.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where A0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where B0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where C0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where D0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where E0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where F0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where G0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where H0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where I0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<J0, K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (J0, K0, L0, M0, N0, O0, P0, Q0, R0)
where J0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<K0, L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (K0, L0, M0, N0, O0, P0, Q0, R0)
where K0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<K, V, S> DecodeLength for BoundedBTreeMap<K, V, S>

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<L0, M0, N0, O0, P0, Q0, R0> DecodeLength for (L0, M0, N0, O0, P0, Q0, R0)
where L0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<M0, N0, O0, P0, Q0, R0> DecodeLength for (M0, N0, O0, P0, Q0, R0)
where M0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<N0, O0, P0, Q0, R0> DecodeLength for (N0, O0, P0, Q0, R0)
where N0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<O0, P0, Q0, R0> DecodeLength for (O0, P0, Q0, R0)
where O0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<P0, Q0, R0> DecodeLength for (P0, Q0, R0)
where P0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<Q0, R0> DecodeLength for (Q0, R0)
where Q0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<R0> DecodeLength for (R0,)
where R0: DecodeLength,

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<T, S> DecodeLength for BoundedBTreeSet<T, S>

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Source§

impl<T, S> DecodeLength for WeakBoundedVec<T, S>

Source§

fn len(self_encoded: &[u8]) -> Result<usize, Error>

Implementors§