pub trait Prepare<T>: SpecByteLen<T = T::V> + Consistency<Val = T::V>{
// Required method
exec fn prepare(&self, v: &T) -> checked : Result<usize, PreSerializeError>;
// Provided method
open spec fn exec_inv(&self) -> bool { ... }
}Expand description
Checks that a value can be serialized and computes its exact output length.
Call this before allocating an output or invoking SerializerExt::serialize
on a value whose consistency has not already been established.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Implementors§
impl Prepare<()> for BerEndFmt
impl Prepare<()> for Empty
impl Prepare<()> for Eof
impl Prepare<BerLength> for BerLengthFmt
impl Prepare<BitStringOwned> for BitStringFmt<false>
Available on crate feature
alloc only.impl Prepare<BmpString> for BmpStringFmt
Available on crate feature
alloc only.impl Prepare<CborInitial> for CborInitialFmt
impl Prepare<ExecNever> for Void
impl Prepare<Ia5StringOwned> for Ia5StringFmt
Available on crate feature
alloc only.impl Prepare<ObjectIdentifier> for ObjectIdentifierFmt
Available on crate feature
alloc only.impl Prepare<PrintableStringOwned> for PrintableStringFmt
Available on crate feature
alloc only.impl Prepare<String> for UniversalStringFmt
Available on crate feature
alloc only.impl Prepare<String> for Utf8StringFmt
Available on crate feature
alloc only.impl Prepare<Tag> for TagFmt
impl Prepare<TeletexStringOwned> for TeletexStringFmt
Available on crate feature
alloc only.impl Prepare<[u8]> for Tail
impl Prepare<i8> for I8
impl Prepare<i8> for Integer8Fmt
impl Prepare<i16> for I16Be
impl Prepare<i16> for I16Le
impl Prepare<i16> for Integer16Fmt
impl Prepare<i32> for I32Be
impl Prepare<i32> for I32Le
impl Prepare<i64> for I64Be
impl Prepare<i64> for I64Le
impl Prepare<u8> for U8
impl Prepare<u16> for U16Be
impl Prepare<u16> for U16Le
impl Prepare<u32> for U24Be
impl Prepare<u32> for U24Le
impl Prepare<u32> for U32Be
impl Prepare<u32> for U32Le
impl Prepare<u64> for U64Be
impl Prepare<u64> for U64Le
impl<'a, const DER: bool> Prepare<Any<'a>> for AnyFmt<DER>
impl<'a, const DER: bool> Prepare<Real<'a, DER>> for RealFmt<DER>
impl<'i, Len: AsLen> Prepare<&'i [u8]> for Varied<Len>
impl<'i, const DER: bool> Prepare<BitString<'i, DER>> for BitStringFmt<DER>
impl<'i, const DER: bool> Prepare<GeneralizedTime<'i>> for GeneralizedTimeFmt<DER>
impl<'i, const DET: bool, const LIMIT: usize> Prepare<CborValue<'i>> for CborFmt<DET, LIMIT>where
CborRecBody<DET>: SpecRecBody<Param = (), T = CborValueSpec, Body = CborBodyFmt<DET>> + PrepareRecBody<CborValue<'i>, EP = ()>,
impl<'i, const N: usize> Prepare<&'i [u8]> for Fixed<N>
impl<'i> Prepare<&'i [u8]> for Tail
impl<'i> Prepare<&'i str> for Utf8StringFmt
impl<'i> Prepare<Ia5String<'i>> for Ia5StringFmt
impl<'i> Prepare<Integer<'i>> for EnumeratedFmt
impl<'i> Prepare<Integer<'i>> for IntegerFmt
impl<'i> Prepare<PrintableString<'i>> for PrintableStringFmt
impl<'i> Prepare<TeletexString<'i>> for TeletexStringFmt
impl<A, AST> Prepare<Option<AST>> for OptionalEnd<A>
impl<A, AVal, B, BVal, const CHECK: bool> Prepare<BVal> for Preceded<A, AVal, B, CHECK>
impl<A, B, AVal, BVal> Prepare<(AVal, BVal)> for PairRev<A, B>
impl<A, B, BVal, T, const CHECK: bool> Prepare<T> for Terminated<A, B, BVal, CHECK>
impl<A, B, C, D, E, TA, TB, TC, TD, TE> Prepare<(TA, (TB, (TC, (TD, TE))))> for Permute5<A, B, C, D, E>
impl<A, B, C, D, TA, TB, TC, TD> Prepare<(TA, (TB, (TC, TD)))> for Permute4<A, B, C, D>
impl<A, B, C, TA, TB, TC> Prepare<(TA, (TB, TC))> for Permute3<A, B, C>
impl<A, B, STA, STB> Prepare<(STA, STB)> for Bind<A, B>
impl<A, B, TA, TB> Prepare<(&[TA], TB)> for Repeat<A, B>
impl<A, B, TA, TB> Prepare<(Option<TA>, TB)> for Optional<A, B>
impl<A, B, TA, TB> Prepare<(TA, TB)> for Pair<A, B>
impl<A, B, TA, TB> Prepare<Sum<TA, TB>> for Choice<A, B>
impl<A, B, TA, TB> Prepare<Sum<TA, TB>> for Sum<A, B>
impl<A, PredFn, T> Prepare<T> for Refined<A, PredFn>
impl<A, T> Prepare<&[T]> for RepeatTillEnd<A>
impl<A, T> Prepare<Option<T>> for Opt<A>
impl<A, T> Prepare<Vec<T>> for RepeatTillEnd<A>
Available on crate feature
alloc only.impl<C, Elem> Prepare<Vec<Elem>> for SetOfFmt<C>
Available on crate feature
alloc only.impl<C, Elem> Prepare<[Elem]> for SetOfFmt<C>
impl<C, T, const LIMIT: usize> Prepare<T> for BerCharStringFmt<C, LIMIT>
impl<C, T> Prepare<&[T]> for BerSequenceOfFmt<C>
impl<C, T> Prepare<T> for BerSequenceFmt<C>
impl<C, T> Prepare<Vec<T>> for BerSequenceOfFmt<C>
Available on crate feature
alloc only.impl<Content, T, const DER: bool> Prepare<T> for ASN1Fmt<Content, DER>
impl<F, T> Prepare<T> for ImplicitlyTaggedFmt<F>
impl<Field, Default, Rest, R, const DER: bool> Prepare<(Default, R)> for DefaultedFmt<Field, Default, Rest, DER>where
Field: SpecByteLen<T = Default> + Prepare<Default>,
Rest: SpecByteLen<T = R::V> + Prepare<R>,
Default: DeepView<V = Default> + PartialEq + Structural + Copy,
R: DeepView,
impl<Inner, M, MRev, T> Prepare<T> for Mapped<Inner, BiMap<M, MRev>>
impl<Inner, N, T> Prepare<[T]> for RepeatN<Inner, N>
impl<Inner, T, const N: usize> Prepare<[T; N]> for Array<N, Inner>
impl<Inner, T> Prepare<&T> for Ref<Inner>
impl<Inner, T> Prepare<T> for Const<Inner, T>
impl<Inner, T> Prepare<[T]> for Star<Inner>
impl<Len, Inner, InnerST> Prepare<InnerST> for ExactLen<Inner, Len>
impl<Len: AsLen> Prepare<[u8]> for Varied<Len>
impl<Of, TagVal, Tg, T> Prepare<T> for SuffixTagged<Of, Tg, TagVal>where
Tg: SpecByteLen<T = TagVal> + Prepare<TagVal>,
TagVal: DeepView<V = TagVal> + PartialEq + Structural + Copy,
T: DeepView,
Of: Prepare<T>,
impl<P1, P2, T1, T2> Prepare<(T1, T2)> for Permute2<P1, P2>
impl<T, Inner> Prepare<T> for Cond<Inner>
impl<T, Inner> Prepare<T> for Named<Inner>
impl<T, Spec, Exec> Prepare<T> for FnPrepare<T, Spec, Exec>where
T: DeepView + ?Sized,
Spec: SpecByteLen<T = T::V> + Consistency<Val = T::V>,
Exec: Fn(&T) -> Result<usize, PreSerializeError>,
impl<T, const LIMIT: usize, Body, Param> Prepare<T> for FixWith<LIMIT, Body, Param>where
T: DeepView<V = Body::T>,
Param: DeepView<V = Body::Param>,
Body: PrepareRecBody<T, EP = Param>,
impl<T, const LIMIT: usize> Prepare<T> for BerBitStringFmt<LIMIT>
impl<Tg, TagVal, Of, T> Prepare<T> for PrefixTagged<Tg, TagVal, Of>where
Tg: SpecByteLen<T = TagVal> + Prepare<TagVal>,
TagVal: DeepView<V = TagVal> + PartialEq + Structural + Copy,
T: DeepView,
Of: Prepare<T>,
impl<Then, T> Prepare<T> for AndThen<Tail, Then>
impl<const DER: bool> Prepare<AnyOwned> for AnyFmt<DER>
Available on crate feature
alloc only.impl<const DER: bool> Prepare<UtcTime> for UtcTimeFmt<DER>
impl<const DER: bool> Prepare<bool> for BoolFmt<DER>
impl<const DER: bool> Prepare<usize> for LengthFmt<DER>
impl<const DET: bool> Prepare<CborHead> for CborHeadFmt<DET>
impl<const LIMIT: usize> Prepare<AnyOwned> for BerAnyFmt<LIMIT>
Available on crate feature
alloc only.impl<const LIMIT: usize> Prepare<Vec<u8>> for BerOctetStringFmt<LIMIT>
Available on crate feature
alloc only.