pub trait TrustedDecodable: Sized {
// Required method
unsafe fn trusted_decode<P>(
producer: &mut P,
) -> impl Future<Output = Result<Self, DecodeError<P::Final, P::Error, Blame>>>
where P: BulkProducer<Item = u8>;
}Expand description
Methods for decoding trusted encodings,that is, data which was already deemed trustworthy prior to encoding.
Required Methods§
Sourceunsafe fn trusted_decode<P>(
producer: &mut P,
) -> impl Future<Output = Result<Self, DecodeError<P::Final, P::Error, Blame>>>where
P: BulkProducer<Item = u8>,
unsafe fn trusted_decode<P>(
producer: &mut P,
) -> impl Future<Output = Result<Self, DecodeError<P::Final, P::Error, Blame>>>where
P: BulkProducer<Item = u8>,
§Safety
This function is only intended to decode types which have been deemed trusted prior to their encoding. Using it to decode encodings from untrusted sources will result in immediate undefined behaviour!
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.