1use core::marker::PhantomData;
2use core::ops::Deref;
3
4use crate::input::Input;
5
6pub struct Peek<'p, I> {
22 input: I,
23 lifetime: PhantomData<&'p ()>,
24}
25
26impl<'p, I> Peek<'p, I> {
27 #[inline(always)]
28 pub(super) fn new(input: I) -> Self {
29 Self {
30 input,
31 lifetime: PhantomData,
32 }
33 }
34}
35
36impl<'p, I> AsRef<I> for Peek<'p, I>
37where
38 I: Input<'p>,
39{
40 #[inline(always)]
41 fn as_ref(&self) -> &I {
42 &self.input
43 }
44}
45
46impl<'p, I> Deref for Peek<'p, I>
47where
48 I: Input<'p>,
49{
50 type Target = I;
51
52 #[inline(always)]
53 fn deref(&self) -> &Self::Target {
54 self.as_ref()
55 }
56}