-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
This feature will be very useful for users who have serialization/deserialization needs.
Adding the serde feature is very easy:
- Add it to the
Cargo.tomlfile
[features]
serde = ["dep:serde", "netlink-packet-route/serde"]
# ...
[dependencies]
serde = { version = "1.0", optional = true, features = ["derive"] }
# ...- Add it before the structure that needs to be serialized/deserialized
/// Internet Protocol (IP) version.
#[derive(Debug, Clone, Eq, PartialEq, PartialOrd)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum IpVersion {
/// IPv4
V4,
/// IPv6
V6,
}Basically achieved the goal.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels