serde_yml::with::nested_singleton_map

Function serialize

Source
pub fn serialize<T, S>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
where T: Serialize, S: Serializer,
Expand description

Serializes a value using the nested singleton map representation.

This function applies the singleton map representation recursively to all nested enums within the value being serialized.

§Arguments

  • value - A reference to the value to be serialized.
  • serializer - The serializer to use for serializing the value.

§Returns

A result containing the serialization output or an error if serialization fails.