pub enum VcardValue<'a> {
Show 15 variants
Adr(VcardAdr<'a>),
Binary(VcardBinary<'a>),
ClientPidMap(VcardClientPidMap<'a>),
DateAndOrTime(VcardDateAndOrTime<'a>),
Gender(VcardGender<'a>),
Geo(VcardGeo<'a>),
LanguageTag(VcardLanguageTag<'a>),
N(VcardN<'a>),
Org(VcardOrg<'a>),
Text(VcardText<'a>),
TextList(VcardTextList<'a>),
Timestamp(VcardTimestamp<'a>),
Uri(VcardUri<'a>),
UtcOffset(VcardUtcOffset<'a>),
Unknown(VcardValueUnknown<'a>),
}Expand description
A decoded property value: one known kind, or Unknown (raw) for anything
the model does not decode.
Variants§
Adr(VcardAdr<'a>)
The structured ADR value.
Binary(VcardBinary<'a>)
A binary value (2.1 / 3.0 PHOTO, LOGO, SOUND, KEY): a URI
reference or inline base64.
ClientPidMap(VcardClientPidMap<'a>)
The structured CLIENTPIDMAP value.
DateAndOrTime(VcardDateAndOrTime<'a>)
A date-and-or-time (BDAY, ANNIVERSARY).
Gender(VcardGender<'a>)
The structured GENDER value.
Geo(VcardGeo<'a>)
A GEO latitude/longitude pair (2.1 / 3.0; 4.0 uses a URI).
LanguageTag(VcardLanguageTag<'a>)
A language tag (LANG).
N(VcardN<'a>)
The structured N value.
Org(VcardOrg<'a>)
The structured ORG value.
Text(VcardText<'a>)
A single text value (FN, TITLE, NOTE, …).
TextList(VcardTextList<'a>)
A comma-separated text list (NICKNAME, CATEGORIES).
Timestamp(VcardTimestamp<'a>)
A timestamp (REV).
Uri(VcardUri<'a>)
A URI (PHOTO, URL, KEY, …).
UtcOffset(VcardUtcOffset<'a>)
A UTC offset (one form of TZ).
Unknown(VcardValueUnknown<'a>)
Any value the model does not decode, kept as its raw components so it round-trips.
Implementations§
Source§impl VcardValue<'_>
impl VcardValue<'_>
Sourcepub fn kind(&self) -> Option<VcardValueKind>
pub fn kind(&self) -> Option<VcardValueKind>
The closed VcardValueKind of this value, or None for
Unknown (which is outside the vocabulary).
Sourcepub fn empty(kind: VcardValueKind) -> VcardValue<'static>
pub fn empty(kind: VcardValueKind) -> VcardValue<'static>
An empty value of the given kind: the inverse of kind,
so empty(k).kind() == Some(k). Every component is blank (an empty
string, list, or structured value); a binary is an empty URI
reference. Used to mint a placeholder for a required property that is
otherwise absent (see VcardCst::fill_required).
Trait Implementations§
Source§impl<'a> Clone for VcardValue<'a>
impl<'a> Clone for VcardValue<'a>
Source§fn clone(&self) -> VcardValue<'a>
fn clone(&self) -> VcardValue<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for VcardValue<'a>
impl<'a> Debug for VcardValue<'a>
impl<'a> Eq for VcardValue<'a>
Source§impl<'a> PartialEq for VcardValue<'a>
impl<'a> PartialEq for VcardValue<'a>
impl<'a> StructuralPartialEq for VcardValue<'a>
Source§impl<'v> VcardCodec<'v> for VcardValue<'v>
Available on crate feature parser only.
impl<'v> VcardCodec<'v> for VcardValue<'v>
parser only.Source§fn decode(node: &'v VcardValueNode<'_>) -> Self
fn decode(node: &'v VcardValueNode<'_>) -> Self
Decode liberally as raw Unknown: no value kind
is known at this level (that is the spec’s job), so the
version-divergent lenses whose target is VcardValue override the lens
decode to resolve the real kind; this fallback is what the others
inherit.
Source§fn encode(&self, escaper: VcardEscaper) -> VcardValueNode<'static>
fn encode(&self, escaper: VcardEscaper) -> VcardValueNode<'static>
Encode by dispatching to the held value’s own codec.