pub enum Property {
Show 44 variants
PropertyAdr(PropertyAdrData),
PropertyAnniversary(PropertyAnniversaryData),
PropertyBDay(PropertyBDayData),
PropertyBirthPlace(PropertyBirthPlaceData),
PropertyCalAdrUri(PropertyCalAdrUriData),
PropertyCalUri(PropertyCalUriData),
PropertyCategories(PropertyCategoriesData),
PropertyClientPidMap(PropertyClientPidMapData),
PropertyContactUri(PropertyContactUriData),
PropertyDeathDate(PropertyDeathDateData),
PropertyDeathPlace(PropertyDeathPlaceData),
PropertyEmail(PropertyEmailData),
PropertyExpertise(PropertyExpertiseData),
PropertyFbUrl(PropertyFbUrlData),
PropertyFn(PropertyFnData),
PropertyGender(PropertyGenderData),
PropertyGeo(PropertyGeoData),
PropertyHobby(PropertyHobbyData),
PropertyImpp(PropertyImppData),
PropertyInterest(PropertyInterestData),
PropertyKey(PropertyKeyData),
PropertyKind(PropertyKindData),
PropertyLang(PropertyLangData),
PropertyLogo(PropertyLogoData),
PropertyMember(PropertyMemberData),
PropertyNickName(PropertyNickNameData),
PropertyNote(PropertyNoteData),
PropertyN(PropertyNData),
PropertyOrgDirectory(PropertyOrgDirectoryData),
PropertyOrg(PropertyOrgData),
PropertyPhoto(PropertyPhotoData),
PropertyProdId(PropertyProdIdData),
PropertyRelated(PropertyRelatedData),
PropertyRev(PropertyRevData),
PropertyRole(PropertyRoleData),
PropertySound(PropertySoundData),
PropertySource(PropertySourceData),
PropertyTel(PropertyTelData),
PropertyTitle(PropertyTitleData),
PropertyTz(PropertyTzData),
PropertyUid(PropertyUidData),
PropertyUrl(PropertyUrlData),
PropertyXml(PropertyXmlData),
PropertyXName(PropertyXNameData),
}Variants§
PropertyAdr(PropertyAdrData)
Represents an ADR parameter, see RFC 6350 6.3.1.
PropertyAnniversary(PropertyAnniversaryData)
Represents an ANNIVERSARY parameter, see RFC 6350 6.2.6.
PropertyBDay(PropertyBDayData)
Represents an BDAY parameter, see RFC 6350 6.2.5.
PropertyBirthPlace(PropertyBirthPlaceData)
Represents an BIRTHPLACE parameter, see RFC 6474 2.1.
PropertyCalAdrUri(PropertyCalAdrUriData)
Represents an CALADRURI parameter, see RFC 6350 6.9.2.
PropertyCalUri(PropertyCalUriData)
Represents an CALURI parameter, see RFC 6350 6.9.3.
PropertyCategories(PropertyCategoriesData)
Represents an CATEGORIES parameter, see RFC 6350 6.7.1.
PropertyClientPidMap(PropertyClientPidMapData)
Represents an CLIENTPIDMAP parameter, see RFC 6350 6.7.1.
PropertyContactUri(PropertyContactUriData)
Represents an CONTACT parameter, see RFC 8605 2.1.
PropertyDeathDate(PropertyDeathDateData)
Represents an DEATHDATE parameter, see RFC 6474 2.3.
PropertyDeathPlace(PropertyDeathPlaceData)
Represents an DEATHPLACE parameter, see RFC 6474 2.2.
PropertyEmail(PropertyEmailData)
Represents an EMAIL parameter, see RFC 6350 6.4.2.
PropertyExpertise(PropertyExpertiseData)
Represents an EXPERTISE parameter, see RFC 6715 2.1.
PropertyFbUrl(PropertyFbUrlData)
Represents an FBURL parameter, see RFC 6350 6.9.1.
PropertyFn(PropertyFnData)
Represents an FN parameter, see RFC 6350 6.2.1.
PropertyGender(PropertyGenderData)
Represents an GENDER parameter, see RFC 6350 6.2.7.
PropertyGeo(PropertyGeoData)
Represents an GEO parameter, see RFC 6350 6.5.2.
PropertyHobby(PropertyHobbyData)
Represents an HOBBY parameter, see RFC 6715 2.2.
PropertyImpp(PropertyImppData)
Represents an IMPP parameter, see RFC 6350 6.4.3.
PropertyInterest(PropertyInterestData)
Represents an INTEREST parameter, see RFC 6715 2.3.
PropertyKey(PropertyKeyData)
Represents an KEY parameter, see RFC 6350 6.8.1.
PropertyKind(PropertyKindData)
Represents an KIND parameter, see RFC 6350 6.1.4.
PropertyLang(PropertyLangData)
Represents an LANG parameter, see RFC 6350 6.4.4.
PropertyLogo(PropertyLogoData)
Represents an LOGO parameter, see RFC 6350 6.6.3.
PropertyMember(PropertyMemberData)
Represents an MEMBER parameter, see RFC 6350 6.6.5.
PropertyNickName(PropertyNickNameData)
Represents an NICKNAME parameter, see RFC 6350 6.2.3.
PropertyNote(PropertyNoteData)
Represents an NOTE parameter, see RFC 6350 6.7.2.
PropertyN(PropertyNData)
Represents an N parameter, see RFC 6350 6.2.2.
PropertyOrgDirectory(PropertyOrgDirectoryData)
Represents an ORG-DIRECTORY parameter, see RFC 6715 2.4.
PropertyOrg(PropertyOrgData)
Represents an ORG parameter, see RFC 6350 6.6.4.
PropertyPhoto(PropertyPhotoData)
Represents an PHOTO parameter, see RFC 6350 6.2.4.
PropertyProdId(PropertyProdIdData)
Represents an PRODID parameter, see RFC 6350 6.7.3.
PropertyRelated(PropertyRelatedData)
Represents an RELATED parameter, see RFC 6350 6.6.6.
PropertyRev(PropertyRevData)
Represents an REV parameter, see RFC 6350 6.7.4.
PropertyRole(PropertyRoleData)
Represents an ROLE parameter, see RFC 6350 6.6.2.
PropertySound(PropertySoundData)
Represents an SOUND parameter, see RFC 6350 6.7.5.
PropertySource(PropertySourceData)
Represents an SOURCE parameter, see RFC 6350 6.1.3.
PropertyTel(PropertyTelData)
Represents an TEL parameter, see RFC 6350 6.4.1.
PropertyTitle(PropertyTitleData)
Represents an TITLE parameter, see RFC 6350 6.6.1.
PropertyTz(PropertyTzData)
Represents an TZ parameter, see RFC 6350 6.5.1.
PropertyUid(PropertyUidData)
Represents an UID parameter, see RFC 6350 6.7.6.
PropertyUrl(PropertyUrlData)
Represents an URL parameter, see RFC 6350 6.7.8.
PropertyXml(PropertyXmlData)
Represents an XML parameter, see RFC 6350 6.1.5.
PropertyXName(PropertyXNameData)
Represents an XNAME parameter, see RFC 6350 3.3.
Implementations§
Source§impl Property
impl Property
Sourcepub fn create(
(property_group, property_name, property_parameters, property_value): (Option<String>, &str, Vec<Parameter>, &str),
) -> Result<Self, VcardError>
pub fn create( (property_group, property_name, property_parameters, property_value): (Option<String>, &str, Vec<Parameter>, &str), ) -> Result<Self, VcardError>
Create a new property from required information (group, name, parameters, and value).
§Examples
use vcard_parser::traits::HasValue;
use vcard_parser::vcard::property::Property;
use vcard_parser::vcard::value::Value;
use vcard_parser::vcard::value::Value::ValueText;
use vcard_parser::vcard::value::value_text::ValueTextData;
let mut property = Property::default("FN");
assert_eq!(property.export(), "FN:\n");
property.set_value(Value::from(ValueTextData::from("John Doe"))).expect("Unable to set value.");
assert_eq!(property.export(), "FN:John Doe\n");pub fn create_from_data( ((group, name), parameters, (value, folds)): PropertyData<'_>, ) -> Result<Self, VcardError>
pub fn create_from_str(str: &str) -> Result<Self, VcardError>
Sourcepub fn default(name: &str) -> Self
pub fn default(name: &str) -> Self
Create a new property with default values.
§Examples
use vcard_parser::traits::HasValue;
use vcard_parser::vcard::property::Property;
use vcard_parser::vcard::value::Value;
use vcard_parser::vcard::value::Value::ValueText;
use vcard_parser::vcard::value::value_text::ValueTextData;
let mut property = Property::default("FN");
assert_eq!(property.export(), "FN:\n");
property.set_value(Value::from(ValueTextData::from("John Doe"))).expect("Unable to set value.");
assert_eq!(property.export(), "FN:John Doe\n");Sourcepub fn export(&self) -> String
pub fn export(&self) -> String
Export a property without any pid information.
§Examples
use vcard_parser::parse::vcard::vcard;
use vcard_parser::vcard::property::Property;
let mut property = Property::try_from("FN;PID=1:John Doe\n").expect("Unable to parse property.");
assert_eq!(property.to_string(), "FN;PID=1:John Doe\n");
assert_eq!(property.export(), "FN:John Doe\n");Trait Implementations§
Source§impl HasCardinality for Property
impl HasCardinality for Property
Source§impl HasParameters for Property
impl HasParameters for Property
fn allowed_parameters<'a>(&self) -> Vec<&'a str>
fn get_parameters(&self) -> Vec<Parameter>
fn set_parameters(&mut self, parameters: Vec<Parameter>)
fn add_parameters( &mut self, parameters: Vec<Parameter>, ) -> Result<(), VcardError>
fn add_parameter(&mut self, parameter: Parameter) -> Result<(), VcardError>
fn remove_parameter(&mut self, index: usize) -> Result<(), VcardError>
fn has_value_type(&mut self) -> Option<String>
Source§impl PartialEq for Property
Matches properties based on RFC 6350 7.1.2 and RFC 6350 7.1.3.
impl PartialEq for Property
Matches properties based on RFC 6350 7.1.2 and RFC 6350 7.1.3.