Function serde_bencoded::from_bytes_auto

source ·
pub fn from_bytes_auto<'a, T>(b: &'a [u8]) -> DeResult<T>
where T: Deserialize<'a>,
Expand description

The same as from_bytes but deserialize_any will deserialize byte string as str if input bytes are valid UTF-8, otherwise as bytes.

§Note

Thus making impossible to deserialize advanced Serde constructs like tagged enums with some penalty for simpler use cases.