🪪proof_of_uid
Struct ProofOfUID
Hot potato that can collect stamps.
If [ProofOfUID] contains an [ID] stamp it means that the corresponding [UID] has been referenced in [stamp] method.
Struct UIDRequirements
A [ProofOfUID] that can be completed after every required [UID] participates.
Requirements are removed only by presenting the matching [UID]. Once no requirements remain, any caller can [complete] the value. The wrapped proof stays available for read only authorization checks during this process.
Constants
Function new
Creates an empty proof bound to the given UID.
Function new_with_type
Creates an empty proof bound to the given UID and recording the object's type. Aborts if the UID does not match the object's ID.
Function consume
Consumes the proof and returns its stamps. Aborts unless the given UID is the one that created the proof.
Function stamp_with_data
Add a stamp to the proof with some data.
Function stamp
Add a stamp to the proof.
Function unstamp
Removes the stamp for the given UID. Aborts if no such stamp exists.
Function stamps
Borrows the map of stamps keyed by stamper ID.
Function stamps_len
The number of stamps on the proof.
Function has_stamp
Whether the proof carries a stamp for the given ID.
Function has_stamp_with_data
Whether the proof carries a stamp for the given ID with exactly the given data.
Function read_stamp_data_of_id
Returns the data attached to the given ID's stamp, or none if absent.
Function created_from
The ID of the UID that created the proof.
Function type_name
The recorded type of the creating object, if it was provided at construction.
Function into_requirements
Converts this proof into requirements authorized by its creating [UID].
Each ID in remaining must later be removed through [satisfy]. The conversion is one way and the proof can only be recovered through [complete].
Function satisfy
Removes the requirement for the given [UID].
Records an empty stamp when the UID is required. Does nothing if the UID is not required or has already participated.
Function proof
Borrows the wrapped [ProofOfUID] for authorization checks.
Function complete
Completes the requirements and returns the stamps collected before conversion.
Aborts while any required [UID] has not participated.
Last updated

