pub fn serialize<S, T>(
to_serialize: &T,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>Expand description
Helper that can be used in a serde serialize_with derive macro for struct fields that contain base64 encoded data.
Uses the standard base64 encoder.
ยงExamples
#[derive(Serialize)]
struct SomeType {
#[serde(serialize_with = "base64::serialize")]
pub value: Vec<u8>,
}