/// Deserializes the response obtained from the registry canister for a
/// get_value() call, from protobuf.
Deserializes the response obtained from the registry canister for a
get_value() call, from protobuf.
Deserializes the response obtained from the registry canister for a get_value () call from protobuf .
pub fn deserialize_get_value_response(response: Vec<u8>) -> Result<(Vec<u8>, u64), Error> {
    match pb::v1::RegistryGetValueResponse::decode(&response[..]) {
        Ok(response) => {
            if let Some(error) = response.error {
                return Err(Error::from(error));
            }
            Ok((response.value, response.version))
        }
        Err(error) => Err(Error::MalformedMessage(error.to_string())),
    }
}
pub fn deserialize_get_value_response ( response : Vec < u8 > ) -> Result < ( Vec < u8 > , u64 ) , Error > { match pb :: v1 :: RegistryGetValueResponse :: decode ( & response [ .. ] ) { Ok ( response ) => { if let Some ( error ) = response . error { return Err ( Error :: from ( error ) ) ; } Ok ( ( response . value , response . version ) ) } Err ( error ) => Err ( Error :: MalformedMessage ( error . to_string ( ) ) ) , } }
Deserializes the response obtained from the registry canister for a
get_value() call, from protobuf.
Deserializes the response obtained from the registry canister for a get_value () call from protobuf .
response
Vec<u8>