Skip to main content

LegacyBytes

Trait LegacyBytes 

Source
pub trait LegacyBytes: Sized {
    // Required methods
    fn legacy_serialize<S: Serializer>(
        &self,
        serializer: S,
    ) -> Result<S::Ok, S::Error>;
    fn legacy_deserialize<'de, D: Deserializer<'de>>(
        deserializer: D,
    ) -> Result<Self, D::Error>;
}
Expand description

A type whose pre-#748 wire encoding can be recovered (and reproduced).

Required Methods§

Source

fn legacy_serialize<S: Serializer>( &self, serializer: S, ) -> Result<S::Ok, S::Error>

Source

fn legacy_deserialize<'de, D: Deserializer<'de>>( deserializer: D, ) -> Result<Self, D::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: LegacyBytes> LegacyBytes for Arc<[T]>

Same wire shape as Vec<T> (a length then each element) — used for Wire’s Arc<[T]> fields.

Source§

fn legacy_serialize<S: Serializer>( &self, serializer: S, ) -> Result<S::Ok, S::Error>

Source§

fn legacy_deserialize<'de, D: Deserializer<'de>>( deserializer: D, ) -> Result<Self, D::Error>

Source§

impl<T: LegacyBytes> LegacyBytes for Vec<T>

Batches were plain Vecs: a length, then each element in its own legacy encoding.

Source§

fn legacy_serialize<S: Serializer>( &self, serializer: S, ) -> Result<S::Ok, S::Error>

Source§

fn legacy_deserialize<'de, D: Deserializer<'de>>( deserializer: D, ) -> Result<Self, D::Error>

Implementors§

Source§

impl<A: LegacyBytes, B: LegacyBytes> LegacyBytes for PairwiseAuthKey<A, B>

alpha (through Arc) then beta, each in its own legacy encoding.

Source§

impl<C: Curve> LegacyBytes for Point<C>

Points were serde_bytes-encoded GroupEncoding::to_bytes() output. InPlaceCodec is the only public route to those bytes, and it reverses them for big-endian curves, so undo that to recover the original ordering.

Source§

impl<F: FieldExtension> LegacyBytes for DaBit<F>

bit then field, each in its own legacy encoding.

Source§

impl<F: FieldExtension> LegacyBytes for FieldElement<F>

Same encoding as SubfieldElement – see its doc comment for why to_le_bytes, not InPlaceCodec.

Source§

impl<F: FieldExtension> LegacyBytes for SubfieldElement<F>

Field elements were serde_bytes-encoded canonical little-endian bytes.

Source§

impl<V: LegacyBytes, A: LegacyBytes, B: LegacyBytes> LegacyBytes for PairwiseAuthShare<V, A, B>

value, then macs and keys as independently-length-prefixed sequences (unlike the current packed single-blob format — see the module docs).