#[non_exhaustive]pub struct Status {
pub status_list: Option<StatusListRef>,
pub additional: IndexMap<String, Value>,
}Available on crate feature
status-list only.Expand description
The status claim of a referenced token: at least one status mechanism, status_list
being the one this crate implements.
§Examples
use identity_kit::status_list::{Status, StatusListRef};
use serde_json::json;
// Token Status List §6.2.
let status: Status = serde_json::from_value(json!({
"status_list": { "idx": 0, "uri": "https://example.com/statuslists/1" }
}))?;
let reference = status.status_list.as_ref().unwrap();
assert_eq!(reference.idx, 0);
assert_eq!(reference.uri, "https://example.com/statuslists/1");
assert_eq!(status, Status::status_list(StatusListRef::new("https://example.com/statuslists/1", 0)));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.status_list: Option<StatusListRef>The status_list mechanism.
additional: IndexMap<String, Value>Every other mechanism, by name.
Implementations§
Source§impl Status
impl Status
Sourcepub fn status_list(reference: StatusListRef) -> Self
pub fn status_list(reference: StatusListRef) -> Self
A status claim referencing a status list.
Sourcepub fn with_mechanism(
self,
name: impl Into<String>,
value: impl Into<Value>,
) -> Self
pub fn with_mechanism( self, name: impl Into<String>, value: impl Into<Value>, ) -> Self
This claim with the mechanism name set to value.
Sourcepub fn mechanisms(&self) -> impl Iterator<Item = StatusMechanism<'_>>
pub fn mechanisms(&self) -> impl Iterator<Item = StatusMechanism<'_>>
The mechanisms, the status list first.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Status
impl<'de> Deserialize<'de> for Status
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 Status
impl StructuralPartialEq for Status
Auto Trait Implementations§
impl Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnsafeUnpin for Status
impl UnwindSafe for Status
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
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
Compare self to
key and return true if they are equal.