Skip to content

Commit

Permalink
Clarify the non-self-describing nature of postcard (jamesmunns#58)
Browse files Browse the repository at this point in the history
Adds some more doc to the deserializer noting that postcard [is non-self-describing](https://github.com/jamesmunns/postcard/blob/main/src/de/deserializer.rs#L207). My hope is that this will help others avoid any surprises.
  • Loading branch information
huntc authored Jun 15, 2022
1 parent 94377ba commit 2ecd123
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/de/deserializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ use crate::de::flavors::{Flavor, Slice};
/// A structure for deserializing a postcard message. For now, Deserializer does not
/// implement the same Flavor interface as the serializer does, as messages are typically
/// easier to deserialize in place. This may change in the future for consistency, or
/// to support items that cannot be deserialized in-place, such as compressed message types
/// to support items that cannot be deserialized in-place, such as compressed message types.
/// Please note that postcard messages are not self-describing and therefore incompatible with
/// [internally tagged enums](https://serde.rs/enum-representations.html#internally-tagged).
pub struct Deserializer<'de, F: Flavor<'de>> {
flavor: F,
_plt: PhantomData<&'de ()>,
Expand Down

0 comments on commit 2ecd123

Please sign in to comment.