1#[derive(Copy, Clone)]
4pub struct Deferred<'a, T> {
5 pub(crate) idx: usize,
6 pub(crate) initial: T,
7 _phantom: std::marker::PhantomData<&'a T>,
8}
9
10impl<'a, T> Deferred<'a, T> {
11 pub(crate) fn new(idx: usize, initial: T) -> Self {
12 Self {
13 idx: idx,
14 initial: initial,
15 _phantom: std::marker::PhantomData,
16 }
17 }
18}
19
20impl<'a, T> Deferred<'a, T>
21where
22 T: crate::pack::IntoPack,
23 <T as crate::pack::IntoPack>::PackType: crate::pack::FixedLenPack,
24{
25 pub const PACK_LEN: usize =
27 <<T as crate::pack::IntoPack>::PackType as crate::pack::FixedLenPack>::PACK_LEN;
28
29 pub fn pack_len(&mut self) -> usize {
32 Self::PACK_LEN
33 }
34}