Expand description
Serde support for humanized bandwidth.
§Example
use serde::{Serialize, Deserialize};
use bandwidth::Bandwidth;
#[derive(Serialize, Deserialize)]
struct Foo {
#[serde(with = "human_bandwidth::serde")]
bandwidth: Bandwidth,
}Or use the Serde wrapper type:
use serde::{Serialize, Deserialize};
use human_bandwidth::serde::Serde;
use bandwidth::Bandwidth;
#[derive(Serialize, Deserialize)]
struct Foo {
bandwidth: Vec<Serde<Bandwidth>>,
}Structs§
- Serde
- A wrapper type which implements
SerializeandDeserializefor types involvingBandwidth.
Functions§
- deserialize
- Deserializes a
Bandwidthin human-readable format. - serialize
- Serializes a
Bandwidthin human-readable format.