1use crate::*;
2use super::Wrap;
3
4impl<'a, Pe32: pe32::Pe<'a>, Pe64: pe64::Pe<'a>> Wrap<pe32::tls::Tls<'a, Pe32>, pe64::tls::Tls<'a, Pe64>> {
6 #[inline]
8 pub fn pe(&self) -> Wrap<Pe32, Pe64> {
9 match self {
10 Wrap::T32(tls) => Wrap::T32(tls.pe()),
11 Wrap::T64(tls) => Wrap::T64(tls.pe()),
12 }
13 }
14 #[inline]
16 pub fn image(&self) -> Wrap<&'a image::IMAGE_TLS_DIRECTORY32, &'a image::IMAGE_TLS_DIRECTORY64> {
17 match self {
18 Wrap::T32(tls) => Wrap::T32(tls.image()),
19 Wrap::T64(tls) => Wrap::T64(tls.image()),
20 }
21 }
22 #[inline]
24 pub fn raw_data(&self) -> Result<&'a [u8]> {
25 match self {
26 Wrap::T32(tls) => tls.raw_data(),
27 Wrap::T64(tls) => tls.raw_data(),
28 }
29 }
30 #[inline]
32 pub fn slot(&self) -> Result<&'a u32> {
33 match self {
34 Wrap::T32(tls) => tls.slot(),
35 Wrap::T64(tls) => tls.slot(),
36 }
37 }
38 #[inline]
40 pub fn callbacks(&self) -> Result<Wrap<&'a [u32], &'a [u64]>> {
41 match self {
42 Wrap::T32(tls) => Wrap::T32(tls.callbacks()).transpose(),
43 Wrap::T64(tls) => Wrap::T64(tls.callbacks()).transpose(),
44 }
45 }
46}