use std::ops::Deref;
use crate::decoder::{RawPresence, RawStream};
use crate::utils::Presence;
use crate::utils::analyze::AnalyzeViaDeref;
use crate::{DecodeState, Lazy};
pub type Id<'a, S = Lazy> = <S as DecodeState>::LazyOrParsed<RawId<'a>, ParsedId<'a>>;
#[derive(Debug, PartialEq, Clone)]
pub struct RawId<'a> {
pub(crate) presence: RawPresence<'a>,
pub(crate) value: RawIdValue<'a>,
}
#[derive(Debug, PartialEq, Clone)]
pub enum RawIdValue<'a> {
Id32(RawStream<'a>),
Id64(RawStream<'a>),
}
#[derive(Clone, Debug, PartialEq)]
pub struct ParsedId<'a>(pub(crate) Presence<'a, u64>);
impl<'a> Deref for ParsedId<'a> {
type Target = Presence<'a, u64>;
#[inline]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl AnalyzeViaDeref for ParsedId<'_> {}