pub type OwnedPolicy = Policy<Vec<(AttributeTag, AttributeValue)>>;
Expand description

A policy with a vector of attributes, fully allocated and owned. This is in contrast to a policy which is lazily read from a read source. The latter is useful for efficiency, this type is more useful for testing since the values are easier to construct.

Aliased Type§

struct OwnedPolicy {
    pub identity_provider: u32,
    pub created_at: Timestamp,
    pub valid_to: Timestamp,
    pub items: Vec<(AttributeTag, AttributeValue)>,
}

Fields§

§identity_provider: u32

Identity of the identity provider who signed the identity object that this policy is derived from.

§created_at: Timestamp

Timestamp at the beginning of the month when the identity object backing this policy was created. This timestamp has very coarse granularity in order for the identity provider to not be able to link identities they have created with accounts that users created on the chain. as a timestamp (which has millisecond granularity) in order to make it easier to compare with, e.g., slot_time.

§valid_to: Timestamp

Beginning of the month where the identity is no longer valid.

§items: Vec<(AttributeTag, AttributeValue)>

List of attributes, in ascending order of the tag.

Trait Implementations§

source§

impl Deserial for OwnedPolicy

source§

fn deserial<R: Read>(source: &mut R) -> ParseResult<Self>

Attempt to read a structure from a given source, failing if an error occurs during deserialization or reading.
source§

impl<'de> Deserialize<'de> for OwnedPolicy

This implementation of deserialize is only useful when used to deserialize JSON. Other formats could be implemented in the future.

source§

fn deserialize<D>(deserializer: D) -> Result<OwnedPolicy, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serial for OwnedPolicy

source§

fn serial<W: Write>(&self, out: &mut W) -> Result<(), W::Err>

Attempt to write the structure into the provided writer, failing if only part of the structure could be written. Read more