pub trait RelativeEncodable<R> {
// Required method
fn relative_encode<Consumer>(
&self,
reference: &R,
consumer: &mut Consumer,
) -> Result<(), Consumer::Error>
where Consumer: BulkConsumer<Item = u8>;
}Expand description
A type that can be used to encode T to a bytestring encoded relative to R.
This can be used to create more compact encodings from which T can be derived by anyone with R.
Required Methods§
Sourcefn relative_encode<Consumer>(
&self,
reference: &R,
consumer: &mut Consumer,
) -> Result<(), Consumer::Error>where
Consumer: BulkConsumer<Item = u8>,
fn relative_encode<Consumer>(
&self,
reference: &R,
consumer: &mut Consumer,
) -> Result<(), Consumer::Error>where
Consumer: BulkConsumer<Item = u8>,
Encode a value (relative to a reference value) to a bytestring in a specific way that is best described over at willowprotocol.org.
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.