diff --git a/src/structure/tfc/typed.rs b/src/structure/tfc/typed.rs index 002943b..44da190 100644 --- a/src/structure/tfc/typed.rs +++ b/src/structure/tfc/typed.rs @@ -44,9 +44,10 @@ impl TypedDictEntry { Q::from_lexical(self.entry.as_buf()).into() } + #[doc(hidden)] pub fn as_i32(&self) -> Option { match self.datatype { - Datatype::Int32 => Some(self.as_casted_val::()), + Datatype::Int32 => Some(self.as_val::()), Datatype::UInt8 => Some(self.as_casted_val::()), Datatype::Int8 => Some(self.as_casted_val::()), Datatype::UInt16 => Some(self.as_casted_val::()), @@ -55,6 +56,15 @@ impl TypedDictEntry { } } + #[doc(hidden)] + pub fn as_f64(&self) -> Option { + match self.datatype { + Datatype::Float64 => Some(self.as_val::()), + Datatype::Float32 => Some(self.as_casted_val::()), + _ => None, + } + } + pub fn datatype(&self) -> Datatype { self.datatype }