pub async fn decode<T: Decodable + Default>(buffer: &[u8]) -> Result<T, Error>
Decode from a binary buffer.