Function serde_tagged::ser::adj::struc::serialize

source ·
pub fn serialize<S, T, V>(
    serializer: S,
    name: &'static str,
    tag_key: &'static str,
    tag: &T,
    value_key: &'static str,
    value: &V,
) -> Result<S::Ok, S::Error>
where S: Serializer, T: Serialize + ?Sized, V: Serialize + ?Sized,
Expand description

Serializes the specified tag-key, tag, value-key and value as struct.

The specified parameters will be serialized as a struct with with the given name containing two fields. The first field is named according to the given tag-key and contains the tag, the second field is named according to the value-key and contains the given value. The specified serializer performs the actual serialization and thus controls the data format. For more information on this tag-format, see the module documentation.

§Note

You should prefer this method to the Serializer.