serialize

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

Serializes an optional string value, treating empty strings as None

§Arguments

  • value - The optional string value to serialize
  • serializer - The serializer to use

§Returns

A Result containing the serialized value or an error