Skip to main content

VcardValue

Enum VcardValue 

Source
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<'_>

Source

pub fn kind(&self) -> Option<VcardValueKind>

The closed VcardValueKind of this value, or None for Unknown (which is outside the vocabulary).

Source

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>

Source§

fn clone(&self) -> VcardValue<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for VcardValue<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for VcardValue<'a>

Source§

impl<'a> PartialEq for VcardValue<'a>

Source§

fn eq(&self, other: &VcardValue<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for VcardValue<'a>

Source§

impl<'v> VcardCodec<'v> for VcardValue<'v>

Available on crate feature parser only.
Source§

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>

Encode by dispatching to the held value’s own codec.

Auto Trait Implementations§

§

impl<'a> Freeze for VcardValue<'a>

§

impl<'a> RefUnwindSafe for VcardValue<'a>

§

impl<'a> Send for VcardValue<'a>

§

impl<'a> Sync for VcardValue<'a>

§

impl<'a> Unpin for VcardValue<'a>

§

impl<'a> UnsafeUnpin for VcardValue<'a>

§

impl<'a> UnwindSafe for VcardValue<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.