pub struct ArtifactState { /* private fields */ }Expand description
Derived authorization state rebuilt from approval and grant journals.
Implementations§
Source§impl ArtifactState
impl ArtifactState
Sourcepub fn rebuild_from_journal(grant_journal: &[GrantJournalEntry]) -> Self
pub fn rebuild_from_journal(grant_journal: &[GrantJournalEntry]) -> Self
Reconstructs grant state from a persisted grant journal.
Use rebuild_from_journals when approval
artifacts are available and future approval resolutions may be appended.
Sourcepub fn rebuild_from_journals(
approvals: &[ApprovalArtifactEntry],
grant_journal: &[GrantJournalEntry],
) -> Self
pub fn rebuild_from_journals( approvals: &[ApprovalArtifactEntry], grant_journal: &[GrantJournalEntry], ) -> Self
Reconstructs authorization state from persisted side journals.
Unlike apply, this trusts persisted facts without
re-validating them against canonical records; durable stores use it on
load where each journal fact was validated before persistence.
Sourcepub fn active_grants(&self) -> Vec<PolicyGrant>
pub fn active_grants(&self) -> Vec<PolicyGrant>
Returns non-revoked grant candidates in stable grant-id order.
Sourcepub fn apply(
&mut self,
session_id: SessionId,
durable_records: &[RecordEnvelope],
transaction_records: &[RecordEnvelope],
approvals: &[ApprovalArtifactEntry],
grants: &[GrantJournalEntry],
) -> Result<(), ArtifactValidationError>
pub fn apply( &mut self, session_id: SessionId, durable_records: &[RecordEnvelope], transaction_records: &[RecordEnvelope], approvals: &[ApprovalArtifactEntry], grants: &[GrantJournalEntry], ) -> Result<(), ArtifactValidationError>
Applies approval and grant journal facts linked to a transaction.
§Errors
Returns an error when an artifact references a missing canonical record.
Trait Implementations§
Source§impl Clone for ArtifactState
impl Clone for ArtifactState
Source§fn clone(&self) -> ArtifactState
fn clone(&self) -> ArtifactState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ArtifactState
impl Debug for ArtifactState
Source§impl Default for ArtifactState
impl Default for ArtifactState
Source§fn default() -> ArtifactState
fn default() -> ArtifactState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ArtifactState
impl RefUnwindSafe for ArtifactState
impl Send for ArtifactState
impl Sync for ArtifactState
impl Unpin for ArtifactState
impl UnsafeUnpin for ArtifactState
impl UnwindSafe for ArtifactState
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