Function serialize

Source
pub fn serialize<S, T>(
    val: &T,
    ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer, T: JsCast,
Expand description

Serialize any JsCast value.

When used with the Serializer in serde_wasm_bindgen, this serializes the value by passing it through as a JsValue.

This function is compatible with the serde(serialize_with) derive annotation.