1use std::array::TryFromSliceError;
2
3use crate::{error::Error, Precision};
4
5#[derive(Debug, Clone)]
7pub struct Clue(pub(crate) [u8; 68]);
8
9impl Clue {
10 pub fn precision(&self) -> Result<Precision, Error> {
12 self.0[64].try_into()
13 }
14}
15
16impl From<Clue> for Vec<u8> {
17 fn from(value: Clue) -> Self {
18 value.0.into()
19 }
20}
21
22impl TryFrom<&[u8]> for Clue {
23 type Error = TryFromSliceError;
24
25 fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
26 Ok(Self(value.try_into()?))
27 }
28}