fn encode_element(
    buf: &mut BytesMut,
    elem: Option<&Value>,
    ty: &Type
) -> Result<(), Error>