#[non_exhaustive]pub struct EnvelopedVp {
pub context: Context,
pub id: Uri,
pub types: OneOrMany<String>,
}vc only.Expand description
An EnvelopedVerifiablePresentation (VCDM 2.0 §4.12.2): a secured presentation carried
in a data: URL.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.context: Context@context, which must define the type; the base context does.
id: UriThe data: URL holding the secured form.
types: OneOrMany<String>type, including the enveloped type.
Implementations§
Source§impl EnvelopedVp
impl EnvelopedVp
pub fn serialize<__S>(
__self: &EnvelopedVp,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
Source§impl<'de> EnvelopedVp
impl<'de> EnvelopedVp
pub fn deserialize<__D>(__deserializer: __D) -> Result<EnvelopedVp, __D::Error>where
__D: Deserializer<'de>,
Source§impl EnvelopedVp
impl EnvelopedVp
Sourcepub const JWT_MEDIA_TYPE: &'static str = PresentationV2::JWT_MEDIA_TYPE
pub const JWT_MEDIA_TYPE: &'static str = PresentationV2::JWT_MEDIA_TYPE
The media type of the JWT form this crate reads.
Sourcepub fn new(media_type: &str, data: &str) -> Result<Self, CredentialError>
pub fn new(media_type: &str, data: &str) -> Result<Self, CredentialError>
An envelope for data of media_type, in the base context.
data is placed in the URL as is; a JWT needs no encoding, other media types
may.
§Errors
CredentialError::InvalidClaim for id when media_type or data holds a
character a URI cannot.
Sourcepub fn media_type(&self) -> &str
pub fn media_type(&self) -> &str
The media type of the data: URL.
Sourcepub fn to_jwt(&self) -> Result<Jwt, CredentialError>
pub fn to_jwt(&self) -> Result<Jwt, CredentialError>
The JWT the envelope holds.
§Errors
CredentialError::UnsupportedMediaType when the media type is not the JWT
one, and CredentialError::InvalidClaim when the data is not a JWT.
Sourcepub fn check(&self) -> Result<(), CredentialError>
pub fn check(&self) -> Result<(), CredentialError>
Checks that type includes the enveloped type and id is a data: URL.
§Errors
CredentialError::MissingType or CredentialError::NotDataUrl.
Trait Implementations§
Source§impl Clone for EnvelopedVp
impl Clone for EnvelopedVp
Source§impl Debug for EnvelopedVp
impl Debug for EnvelopedVp
Source§impl<'de> Deserialize<'de> for EnvelopedVp
impl<'de> Deserialize<'de> for EnvelopedVp
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Reads the object and checks its type and that id is a data: URL.
impl Eq for EnvelopedVp
Source§impl PartialEq for EnvelopedVp
impl PartialEq for EnvelopedVp
Source§impl PartialSchema for EnvelopedVp
Available on crate feature utoipa only.
impl PartialSchema for EnvelopedVp
utoipa only.Source§impl Serialize for EnvelopedVp
impl Serialize for EnvelopedVp
impl StructuralPartialEq for EnvelopedVp
Auto Trait Implementations§
impl Freeze for EnvelopedVp
impl RefUnwindSafe for EnvelopedVp
impl Send for EnvelopedVp
impl Sync for EnvelopedVp
impl Unpin for EnvelopedVp
impl UnsafeUnpin for EnvelopedVp
impl UnwindSafe for EnvelopedVp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.