Expand description
Trait that allows zero-copy write of value-references to slices in LE format.
Implementations should override using_encoded
for value types and encode_to
and size_hint
for allocating types.
Wrapper types should override all methods.
If possible give a hint of expected size of the encoding.
This method is used inside default implementation of encode
to avoid re-allocations.
Convert self to a slice and append it to the destination.
Convert self to an owned vector.
Convert self to a slice and then invoke the given closure with it.
Calculates the encoded size.
Should be used when the encoded data isn’t required.
This works by using a special Output
that only tracks the size. So, there are no allocations inside the
output. However, this can not prevent allocations that some types are doing inside their own encoding.
impl<A0: Encode, B0: Encode, C0: Encode, D0: Encode, E0: Encode, F0: Encode, G0: Encode, H0: Encode, I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<B0: Encode, C0: Encode, D0: Encode, E0: Encode, F0: Encode, G0: Encode, H0: Encode, I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<C0: Encode, D0: Encode, E0: Encode, F0: Encode, G0: Encode, H0: Encode, I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<D0: Encode, E0: Encode, F0: Encode, G0: Encode, H0: Encode, I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<E0: Encode, F0: Encode, G0: Encode, H0: Encode, I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<F0: Encode, G0: Encode, H0: Encode, I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<G0: Encode, H0: Encode, I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<H0: Encode, I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<I0: Encode, J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<J0: Encode, K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (J0, K0, L0, M0, N0, O0, P0, Q0, R0)
impl<K0: Encode, L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (K0, L0, M0, N0, O0, P0, Q0, R0)
impl<L0: Encode, M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (L0, M0, N0, O0, P0, Q0, R0)
impl<M0: Encode, N0: Encode, O0: Encode, P0: Encode, Q0: Encode, R0: Encode> Encode for (M0, N0, O0, P0, Q0, R0)