pub fn read_gs_typed<T>(&mut self, key: &Key) -> Result<T, Error>
    where
        T: TryFrom<StoredValue>,
        T::Error: Debug,
    {
        let value = match self.read_gs(key)? {
            None => return Err(Error::KeyNotFound(*key)),
            Some(value) => value,
        };

        value.try_into().map_err(|error| {
            Error::FunctionNotFound(format!(
                "Type mismatch for value under {:?}: {:?}",
                key, error
            ))
        })
    }
/// This method is a wrapper over `read_gs` in the sense that it extracts the type held by a
/// `StoredValue` stored in the global state in a type safe manner.
///
/// This is useful if you want to get the exact type from global state.
This method is a wrapper over `read_gs` in the sense that it extracts the type held by a
`StoredValue` stored in the global state in a type safe manner.

This is useful if you want to get the exact type from global state.
This method is a wrapper over ` read_gs ` in the sense that it extracts the type held by a ` StoredValue ` stored in the global state in a type safe manner . This is useful if you want to get the exact type from global state .
pub fn read_gs_typed<T>(&mut self, key: &Key) -> Result<T, Error>
    where
        T: TryFrom<StoredValue>,
        T::Error: Debug,
    {
        let value = match self.read_gs(key)? {
            None => return Err(Error::KeyNotFound(*key)),
            Some(value) => value,
        };
        value.try_into().map_err(|error| {
            Error::FunctionNotFound(format!(
                "Type mismatch for value under {:?}: {:?}",
                key, error
            ))
        })
    }
pub fn read_gs_typed < T > ( & mut self , key : & Key ) -> Result < T , Error > where T : TryFrom < StoredValue > , T :: Error : Debug , { let value = match self . read_gs ( key ) ? { None => return Err ( Error :: KeyNotFound ( * key ) ) , Some ( value ) => value , } ; value . try_into ( ) . map_err ( | error | { Error :: FunctionNotFound ( format ! ( " " key error ) ) } ) }
This method is a wrapper over `read_gs` in the sense that it extracts the type held by a
`StoredValue` stored in the global state in a type safe manner.
This method is a wrapper over ` read_gs ` in the sense that it extracts the type held by a ` StoredValue ` stored in the global state in a type safe manner .
&mut self
key
&Key
&mut self
key
&Key