pub fn gen_with_len<W: Write + BackToTheBuffer, F: SerializeFn<W>>(f: F) -> impl SerializeFn<W> {
    back_to_the_buffer(
        4,
        move |x| {
            let start = x.position;
            let x = f(x)?;
            let len = x.position - start;
            Ok((x, len))
        },
        move |x, len| gen_long_uint(len as LongUInt)(x),
    )
}
/// Apply a generator and serialize its length at the beginning of buffer
Apply a generator and serialize its length at the beginning of buffer
Apply a generator and serialize its length at the beginning of buffer
pub fn gen_with_len<W: Write + BackToTheBuffer, F: SerializeFn<W>>(f: F) -> impl SerializeFn<W> {
    back_to_the_buffer(
        4,
        move |x| {
            let start = x.position;
            let x = f(x)?;
            let len = x.position - start;
            Ok((x, len))
        },
        move |x, len| gen_long_uint(len as LongUInt)(x),
    )
}
pub fn gen_with_len < W : Write + BackToTheBuffer , F : SerializeFn < W > > ( f : F ) -> impl SerializeFn < W > { back_to_the_buffer ( 4 , move | x | { let start = x . position ; let x = f ( x ) ? ; let len = x . position - start ; Ok ( ( x , len ) ) } , move | x , len | gen_long_uint ( len as LongUInt ) ( x ) , ) }
Apply a generator and serialize its length at the beginning of buffer
Apply a generator and serialize its length at the beginning of buffer
f
F