Skip to main content

serialize_angle

Function serialize_angle 

Source
pub fn serialize_angle<S, T>(
    value: &T,
    serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer, T: Serialize, &'a T: for<'a> ToString,
Expand description

Enables serialization of an angle into a string containing both the value and the “rad” unit.

When a value is serialized using serialize_with_units, this function stores an angle as a string containing both the raw value and the “rad” unit. If serialize_with_units is not used, this function serializes its field using the default Serialize implementation of the type.

For examples see the serialize_with_units documentation.