Skip to main content

deserialize_with_context

Function deserialize_with_context 

Source
pub fn deserialize_with_context<'de, Ctx, T>(
    ctx: Ctx,
    src: &'de [u8],
) -> ReadResult<T>
where T: SchemaReadContext<'de, DefaultConfig, Ctx, Dst = T>,
Expand description

Deserialize a type from the given bytes using the provided context.

ยงExamples

use bumpalo::{Bump, collections::String};

let serialized = wincode::serialize("w1nc0d3").unwrap();

let bump = Bump::new();
let value: String = wincode::deserialize_with_context(&bump, &serialized).unwrap();
assert_eq!(value, "w1nc0d3");