pub struct ConsentRecord {
pub provider_id: String,
pub data_flow: DataFlow,
pub granted_scope: String,
pub granted_at: Option<String>,
}Expand description
A recorded consent decision for one provider. granted_scope is the
human-readable description of what data flows out, shown to the user at
consent time and retained as the audit of what they agreed to (SPEC.md §4).
Fields§
§provider_id: StringThe provider id this consent applies to (the host’s routing key).
data_flow: DataFlowThe data-flow direction the user consented to — names what leaves.
granted_scope: StringHuman-readable scope: what content is permitted to leave the machine.
granted_at: Option<String>When consent was granted (RFC 3339), if the host records it.
Implementations§
Source§impl ConsentRecord
impl ConsentRecord
Sourcepub fn new(
provider_id: impl Into<String>,
data_flow: DataFlow,
granted_scope: impl Into<String>,
) -> Self
pub fn new( provider_id: impl Into<String>, data_flow: DataFlow, granted_scope: impl Into<String>, ) -> Self
Record consent for a provider, naming the data-flow direction and the scope of what may leave.
granted_at is left unset here and stamped by
ConsentStore::record at the moment the decision enters the ledger —
the only place that can honestly claim to know when consent was
given. Use granted_at to supply your own instant
(replaying a persisted decision, or a host with its own clock).
Sourcepub fn granted_at(self, when: impl Into<String>) -> Self
pub fn granted_at(self, when: impl Into<String>) -> Self
Pin when this consent was granted, as a protocol timestamp
(SPEC.md §6.1 F4).
A non-F4 instant is rejected rather than stored: the ledger is the audit trail, and a timestamp nobody can parse is worse than the absence the field already models honestly. Same guard the temporal fields carry on the wire — never emit a string outside the profile.
Trait Implementations§
Source§impl Clone for ConsentRecord
impl Clone for ConsentRecord
Source§fn clone(&self) -> ConsentRecord
fn clone(&self) -> ConsentRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more