Function candid::utils::decode_one[][src]

pub fn decode_one<'a, T>(bytes: &'a [u8]) -> Result<T> where
    T: Deserialize<'a> + CandidType
Expand description

Decode a single argument.

Example:

let golden1 = 123u64;
let bytes = Encode!(&golden1).unwrap();
let value1: u64 = decode_one(&bytes).unwrap();

assert_eq!(golden1, value1);