RDAP uses jCard (the JSON version of vCard) for contact information. The library provides a contact::Contact struct that simplifies this by allowing you to build contacts using a builder and converting them to/from jCard/vCard formats.
Building and Serializing a Contact
Use Contact::builder() to create a contact, then use .to_vcard() to get a serde_json::Value which can be serialized to JSON.
use icann_rdap_common::contact::Contact;
use serde::Serialize;
use serde_json::Value;
let contact = Contact::builder()
.kind("individual")
.full_name("Bob Smurd")
.build();
let v = contact.to_vcard();
let json = serde_json::to_string(&v);
Deserializing a Contact from jCard
To deserialize, use Contact::from_vcard(&data) where data is a Vec<serde_json::Value> representing the jCard array.
use icann_rdap_common::contact::Contact;
use serde::Deserialize;
use serde_json::Value;
let json = r#"["vcard", [["version", {}, "text", "4.0"], ["fn", {}, "text", "Joe User"]]]"#;
let data: Vec<Value> = serde_json::from_str(json).unwrap();
let contact = Contact::from_vcard(&data);