Function from_slice

Source
pub fn from_slice<'de, B, T>(bytes: &'de [u8]) -> Result<T, DeserializerError>
where T: Deserialize<'de>, B: ByteOrder,
Expand description

Deserialize a Pyth wire-format buffer into a type.

Note that this method will not consume left-over bytes ore report errors. This is due to the fact that the Pyth wire formatted is intended to allow for appending of new fields without breaking backwards compatibility. As such, it is possible that a newer version of the format will contain fields that are not known to the deserializer. This is not an error, and the deserializer will simply ignore these fields.