Let's have a look at bincode on docs.rs. Then let's have a look at the Serializer
and Deserializer
structs. They are defined like this:
// in de/mod.rs
pub struct Deserializer<R, O: Options> {
pub(crate) reader: R,
options: O,
}
// in ser/mod.rs
pub struct Serializer<W, O: Options> {
writer: W,
_options: O,
}
Then they are re-exported like this:
// in lib.rs
pub use config::{Config, DefaultOptions, Options};
pub use de::read::BincodeRead;
pub use de::Deserializer;
pub use error::{Error, ErrorKind, Result};
pub use ser::Serializer;
So they are basically treated symmetrically. Nonetheless, if we look at the docs page, it shows Deserializer
under "Re-exports" and Serializer
under "Structs". Why is that?