pub struct ContactSection {
pub entries: Vec<ContactEntry>,
}Expand description
Contact directory section of an OAS Identity Document.
Contains all reachable channels for an entity, each with independent visibility controls.
§Standard Entry Types
| Type | Value Format | Example |
|---|---|---|
phone | tel: URI (E.164) | tel:+15551234567 |
email | mailto: URI | mailto:agent@acme.com |
social | HTTPS URL to profile | https://x.com/agent42 |
website | HTTPS URL | https://acme.com/agent |
messaging | HTTPS URL or protocol-specific URI | https://t.me/agent_bot |
§Examples
use oas_document::contact::{ContactSection, ContactEntry};
use oas_document::visibility::Visibility;
let contact = ContactSection {
entries: vec![
ContactEntry {
id: "email-1".to_string(),
entry_type: "email".to_string(),
value: "mailto:hello@agent.ai".to_string(),
label: Some("Primary".to_string()),
platform: None,
handle: None,
visibility: Visibility::Public,
verified: Some(true),
},
ContactEntry {
id: "social-x".to_string(),
entry_type: "social".to_string(),
value: "https://x.com/agent42".to_string(),
label: None,
platform: Some("x".to_string()),
handle: Some("@agent42".to_string()),
visibility: Visibility::Public,
verified: None,
},
],
};
assert_eq!(contact.entries.len(), 2);Fields§
§entries: Vec<ContactEntry>All contact entries for this entity.
Trait Implementations§
Source§impl Clone for ContactSection
impl Clone for ContactSection
Source§impl Debug for ContactSection
impl Debug for ContactSection
Source§impl<'de> Deserialize<'de> for ContactSection
impl<'de> Deserialize<'de> for ContactSection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ContactSection
Source§impl PartialEq for ContactSection
impl PartialEq for ContactSection
Source§impl Serialize for ContactSection
impl Serialize for ContactSection
impl StructuralPartialEq for ContactSection
Auto Trait Implementations§
impl Freeze for ContactSection
impl RefUnwindSafe for ContactSection
impl Send for ContactSection
impl Sync for ContactSection
impl Unpin for ContactSection
impl UnsafeUnpin for ContactSection
impl UnwindSafe for ContactSection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more