vcard/parameters/
property_id.rs1use std::fmt::Display;
2
3use validators::{Validated, ValidatedWrapper};
4
5use super::{
6 super::{
7 values::{property_id_value::PropertyIDValue, Value},
8 Set,
9 },
10 *,
11};
12
13#[derive(Clone, Debug, PartialEq, Eq, Hash)]
14pub struct PropertyID {
15 ids: Set<PropertyIDValue>,
16}
17
18impl PropertyID {
19 pub fn from_ids(ids: Set<PropertyIDValue>) -> PropertyID {
20 PropertyID {
21 ids,
22 }
23 }
24}
25
26impl PropertyID {
27 pub fn get_ids(&self) -> &Set<PropertyIDValue> {
28 &self.ids
29 }
30}
31
32impl Parameter for PropertyID {
33 fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
34 f.write_str(";PID=")?;
35
36 Value::fmt(&self.ids, f)?;
37
38 Ok(())
39 }
40}
41
42impl Display for PropertyID {
43 fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
44 Parameter::fmt(self, f)
45 }
46}
47
48impl Validated for PropertyID {}
49
50impl ValidatedWrapper for PropertyID {
51 type Error = &'static str;
52
53 fn from_string(_from_string_input: String) -> Result<Self, Self::Error> {
54 unimplemented!();
55 }
56
57 fn from_str(_from_str_input: &str) -> Result<Self, Self::Error> {
58 unimplemented!();
59 }
60}