Function serde_bytes::deserialize [−][src]
pub fn deserialize<'de, T, D>(deserializer: D) -> Result<T, D::Error> where
T: Deserialize<'de>,
D: Deserializer<'de>,
Serde deserialize_with
function to deserialize bytes efficiently.
This function can be used with either of the following Serde attributes:
#[serde(with = "serde_bytes")]
#[serde(deserialize_with = "serde_bytes::deserialize")]
use serde::Deserialize; #[derive(Deserialize)] struct Packet { #[serde(with = "serde_bytes")] payload: Vec<u8>, }