Expand description
DEPRECATED: Since Rust 1.31 it’s possible to rename dependencies. There is no need to use this crate anymore.
A hack to allow having a feature named serde which doesn’t just depend on serde
In Cargo.toml, you can do the following:
[dependencies]
serde-feature-hack = { version = "0.1.0", optional = true }
[features]
serde = ["serde-feature-hack", "some-other-dependency"]Then, you can use serde like you normally would.
extern crate serde;
extern crate serde_json;
use serde::{Serialize, Serializer};
struct X;
impl Serialize for X {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str("Hello, world!")
}
}
assert_eq!(serde_json::to_string(&X).unwrap(), r#""Hello, world!""#);Modules§
- de
- Generic data structure deserialization framework.
- ser
- Generic data structure serialization framework.
Macros§
- forward_
to_ deserialize_ any - Helper macro when implementing the
Deserializerpart of a new data format for Serde.
Traits§
- Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- Deserializer
- A data format that can deserialize any data structure supported by Serde.
- Serialize
- A data structure that can be serialized into any data format supported by Serde.
- Serializer
- A data format that can serialize any data structure supported by Serde.