use crate::{codec::DecodeError, prelude::*};
pub trait RelativeDecodable<RelativeTo, Symbol = u8>: Sized {
type ErrorReason;
async fn relative_decode<P>(
rel: &RelativeTo,
producer: &mut P,
) -> Result<Self, DecodeError<P::Final, P::Error, Self::ErrorReason>>
where
P: BulkProducer<Item = Symbol> + ?Sized,
Self: Sized;
}
pub trait RelativeDecodableCanonic<RelativeTo, Symbol = u8>:
RelativeDecodable<RelativeTo, Symbol>
{
type ErrorCanonic: From<Self::ErrorReason>;
async fn relative_decode_canonic<P>(
rel: &RelativeTo,
producer: &mut P,
) -> Result<Self, DecodeError<P::Final, P::Error, Self::ErrorCanonic>>
where
P: BulkProducer<Item = Symbol> + ?Sized,
Self: Sized;
}