Lines Matching full:descriptors
5 //! Provides infrastructure for de/serializing descriptors embedded in Rust data structures.
22 //! // Wraps Serialize types to collect side channel descriptors as Serialize is called.
25 //! // Use the wrapper with any serializer to serialize data is normal, grabbing descriptors
30 //! // (it contains tmp_f in this case), we can retrieve the actual descriptors
45 //! // to side channel descriptors.
72 let mut descriptors = d.borrow_mut(); in init_descriptor_dst() localVariable
73 if descriptors.is_some() { in init_descriptor_dst()
78 *descriptors = Some(Default::default()); in init_descriptor_dst()
92 /// Pushes a descriptor on the thread local destination of descriptors, returning the index in which
101 .map(|descriptors| { in push_descriptor()
102 let index = descriptors.len(); in push_descriptor()
103 descriptors.push(rd); in push_descriptor()
123 .map_err(|_| ser::Error::custom("attempt to serialize too many descriptors at once"))?, in serialize_descriptor()
127 /// Wrapper for a `Serialize` value which will capture any descriptors exported by the value when
146 /// // If `serialize_descriptor` was called, we can capture the descriptors from here.
183 /// Sets the thread local storage of descriptors for deserialization. Fails if this was already
186 /// This is given as a collection of `Option` so that unused descriptors can be returned.
187 fn set_descriptor_src(descriptors: Vec<Option<SafeDescriptor>>) -> Result<(), &'static str> { in set_descriptor_src()
193 *src = Some(descriptors); in set_descriptor_src()
198 /// Takes the thread local storage of descriptors for deserialization. Fails if the storage was
201 /// If deserialization was done, the descriptors will mostly come back as `None` unless some of them
210 /// Takes a descriptor at the given index from the thread local source of descriptors.
290 /// descriptors for use in `deserialize_descriptor`.
298 descriptors: &mut Vec<Option<SafeDescriptor>>, in deserialize_with_descriptors()
304 let swap_descriptors = std::mem::take(descriptors); in deserialize_with_descriptors()
313 *descriptors = take_descriptor_src().unwrap(); in deserialize_with_descriptors()
441 fn deserialize<T: DeserializeOwned>(json: &str, descriptors: &[RawDescriptor]) -> T { in deserialize()
442 let mut safe_descriptors = descriptors in deserialize()
464 // descriptors for this test. in raw()
469 let descriptors = v_serialize.into_descriptors(); in raw() localVariable
470 let res = deserialize(&json, &descriptors); in raw()
487 let descriptors = v_serialize.into_descriptors(); in file() localVariable
489 let res: FileContainer = deserialize(&json, &descriptors); in file()
507 let descriptors = v_serialize.into_descriptors(); in option() localVariable
509 let res: TestOption = deserialize(&json, &descriptors); in option()
526 let descriptors = v_serialize.into_descriptors(); in map() localVariable
534 let res: HashMap<String, FileSerdeWrapper> = deserialize(&json, &descriptors); in map()