ssi_vc/v2/data_model/
presentation.rs

1use iref::Uri;
2
3use super::Credential;
4
5pub use crate::v1::PresentationTypes;
6use crate::{Identified, MaybeIdentified};
7
8/// Verifiable Presentation.
9pub trait Presentation: MaybeIdentified {
10    /// Verifiable credential type.
11    type Credential: Credential;
12
13    /// Holder.
14    type Holder: Identified;
15
16    /// Identifier.
17    fn id(&self) -> Option<&Uri> {
18        MaybeIdentified::id(self)
19    }
20
21    /// Types, without the `VerifiablePresentation` type.
22    fn additional_types(&self) -> &[String] {
23        &[]
24    }
25
26    fn types(&self) -> PresentationTypes {
27        PresentationTypes::from_additional_types(self.additional_types())
28    }
29
30    fn verifiable_credentials(&self) -> &[Self::Credential] {
31        &[]
32    }
33
34    fn holders(&self) -> &[Self::Holder] {
35        &[]
36    }
37}