vcard-rs 0.3.0

vCard parser, validator, editor and builder library for Rust
Documentation
//! # SOURCE
//!
//! The `SOURCE` property: a URI from which the directory information of
//! the card can be retrieved, decoded as a `VcardUri` (RFC 6350 6.1.3).

use crate::{
    param::VcardParamKind,
    prop::{VcardPropKind, spec::VcardPropSpec},
    value::VcardValueKind,
    version::VcardVersion,
};

/// The `SOURCE` property marker.
pub struct SOURCE;

impl VcardPropSpec for SOURCE {
    const KIND: VcardPropKind = VcardPropKind::Source;

    fn allowed_versions() -> &'static [VcardVersion] {
        &[VcardVersion::V3_0, VcardVersion::V4_0]
    }

    fn allowed_values(_version: VcardVersion) -> &'static [VcardValueKind] {
        &[VcardValueKind::Uri]
    }

    fn allowed_params(_version: VcardVersion) -> &'static [VcardParamKind] {
        &[
            VcardParamKind::Pid,
            VcardParamKind::Pref,
            VcardParamKind::AltId,
            VcardParamKind::MediaType,
            VcardParamKind::Value,
        ]
    }
}