/// Serializes the arguments for a request to the get_value() function in the
/// registry canister, into protobuf.
Serializes the arguments for a request to the get_value() function in the
registry canister, into protobuf.
Serializes the arguments for a request to the get_value () function in the registry canister into protobuf .
pub fn serialize_get_value_request(
    key: Vec<u8>,
    version_opt: Option<u64>,
) -> Result<Vec<u8>, Error> {
    let mut request: pb::v1::RegistryGetValueRequest = pb::v1::RegistryGetValueRequest {
        key,
        ..Default::default()
    };
    if let Some(version) = version_opt {
        request.version = Some(version);
    }
    let mut buf = Vec::new();
    match request.encode(&mut buf) {
        Ok(_) => Ok(buf),
        Err(error) => Err(Error::MalformedMessage(error.to_string())),
    }
}
pub fn serialize_get_value_request ( key : Vec < u8 > , version_opt : Option < u64 > , ) -> Result < Vec < u8 > , Error > { let mut request : pb :: v1 :: RegistryGetValueRequest = pb :: v1 :: RegistryGetValueRequest { key , .. Default :: default ( ) } ; if let Some ( version ) = version_opt { request . version = Some ( version ) ; } let mut buf = Vec :: new ( ) ; match request . encode ( & mut buf ) { Ok ( _ ) => Ok ( buf ) , Err ( error ) => Err ( Error :: MalformedMessage ( error . to_string ( ) ) ) , } }
Serializes the arguments for a request to the get_value() function in the
registry canister, into protobuf.
Serializes the arguments for a request to the get_value () function in the registry canister into protobuf .
key
Vec<u8>
version_opt
Option<u64>