ssi_status

Trait StatusMap

Source
pub trait StatusMap: Clone {
    type Key;
    type StatusSize;
    type Status;

    // Required method
    fn get_by_key(
        &self,
        status_size: Option<Self::StatusSize>,
        key: Self::Key,
    ) -> Result<Option<Self::Status>, StatusSizeError>;

    // Provided methods
    fn time_to_live(&self) -> Option<Duration> { ... }
    fn get_entry<E: StatusMapEntry<Key = Self::Key, StatusSize = Self::StatusSize>>(
        &self,
        entry: &E,
    ) -> Result<Option<Self::Status>, StatusSizeError> { ... }
}
Expand description

Status map.

A status map is a map from StatusMapEntry to StatusMap::Status. The StatusMapEntry is generally found in the credential or claims you need to verify.

Required Associated Types§

Source

type Key

Key indexing each status in the map.

Source

type StatusSize

Status bit size type.

Source

type Status

Status type.

Required Methods§

Source

fn get_by_key( &self, status_size: Option<Self::StatusSize>, key: Self::Key, ) -> Result<Option<Self::Status>, StatusSizeError>

Returns a status using the given status size and key.

If status_size is None, it is assumed that the map itself knows the status size. If it does not, a StatusSizeError::Missing error is returned.

Provided Methods§

Source

fn time_to_live(&self) -> Option<Duration>

Maximum duration an implementer is allowed to cache a status list.

Source

fn get_entry<E: StatusMapEntry<Key = Self::Key, StatusSize = Self::StatusSize>>( &self, entry: &E, ) -> Result<Option<Self::Status>, StatusSizeError>

Returns the status associated to the given entry.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl StatusMap for AnyDecodedStatusMap

Source§

impl StatusMap for ssi_status::bitstring_status_list::StatusList

Source§

impl StatusMap for ssi_status::bitstring_status_list_20240406::StatusList

Source§

impl StatusMap for ssi_status::token_status_list::StatusList