Skip to main content

tzf_rs/pbgen/
mod.rs

1use prost::Message;
2
3pub mod tzf {
4    pub mod v1 {
5        include!("tzf.v1.rs");
6    }
7}
8pub use tzf::v1::*;
9
10impl TryFrom<Vec<u8>> for Timezones {
11    type Error = anyhow::Error;
12
13    fn try_from(value: Vec<u8>) -> Result<Self, Self::Error> {
14        Ok(Self::decode(&value[..])?)
15    }
16}
17
18impl TryFrom<Vec<u8>> for PreindexTimezones {
19    type Error = anyhow::Error;
20
21    fn try_from(value: Vec<u8>) -> Result<Self, Self::Error> {
22        Ok(Self::decode(&value[..])?)
23    }
24}
25
26impl TryFrom<Vec<u8>> for CompressedTopoTimezones {
27    type Error = anyhow::Error;
28
29    fn try_from(value: Vec<u8>) -> Result<Self, Self::Error> {
30        Ok(Self::decode(&value[..])?)
31    }
32}
33
34impl TryFrom<&'static [u8]> for CompressedTopoTimezones {
35    type Error = anyhow::Error;
36
37    fn try_from(value: &'static [u8]) -> Result<Self, Self::Error> {
38        Ok(Self::decode(value)?)
39    }
40}