pub struct ToolExecutionPermit { /* private fields */ }Implementations§
Source§impl ToolExecutionPermit
impl ToolExecutionPermit
Sourcepub fn new(
execution_permit_id: ExecutionPermitId,
decision_id: PolicyDecisionId,
approval_record_id: Option<ApprovalRecordId>,
namespace: impl Into<String>,
target_key: impl Into<String>,
method_digest: ContentDigest,
effect_digest: ContentDigest,
expires_at: Option<DateTime<Utc>>,
nonce: impl Into<String>,
) -> Self
pub fn new( execution_permit_id: ExecutionPermitId, decision_id: PolicyDecisionId, approval_record_id: Option<ApprovalRecordId>, namespace: impl Into<String>, target_key: impl Into<String>, method_digest: ContentDigest, effect_digest: ContentDigest, expires_at: Option<DateTime<Utc>>, nonce: impl Into<String>, ) -> Self
Builds a runtime execution permit snapshot for effectful tool dispatch.
Sourcepub fn execution_permit_id(&self) -> &ExecutionPermitId
pub fn execution_permit_id(&self) -> &ExecutionPermitId
Returns the execution permit identifier.
Sourcepub fn decision_id(&self) -> &PolicyDecisionId
pub fn decision_id(&self) -> &PolicyDecisionId
Returns the policy decision lineage bound to this permit.
Sourcepub fn approval_record_id(&self) -> Option<&ApprovalRecordId>
pub fn approval_record_id(&self) -> Option<&ApprovalRecordId>
Returns the optional approval-record lineage bound to this permit.
Sourcepub fn scope(&self) -> &ToolExecutionPermitScope
pub fn scope(&self) -> &ToolExecutionPermitScope
Returns the namespace/target scope enforced by this permit.
Sourcepub fn expires_at(&self) -> Option<&DateTime<Utc>>
pub fn expires_at(&self) -> Option<&DateTime<Utc>>
Returns the expiry instant, when the issuing policy imposed one.
Sourcepub fn method_digest(&self) -> &ContentDigest
pub fn method_digest(&self) -> &ContentDigest
Returns the tool method digest bound to this permit.
Sourcepub fn effect_digest(&self) -> &ContentDigest
pub fn effect_digest(&self) -> &ContentDigest
Returns the typed effect digest bound to this permit.
Sourcepub fn validate_binding(
&self,
method_digest: &ContentDigest,
effect_digest: &ContentDigest,
now: DateTime<Utc>,
) -> Result<(), ToolError>
pub fn validate_binding( &self, method_digest: &ContentDigest, effect_digest: &ContentDigest, now: DateTime<Utc>, ) -> Result<(), ToolError>
Validates expiry and exact method/effect bindings without consuming the permit.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ToolExecutionPermit
impl RefUnwindSafe for ToolExecutionPermit
impl Send for ToolExecutionPermit
impl Sync for ToolExecutionPermit
impl Unpin for ToolExecutionPermit
impl UnsafeUnpin for ToolExecutionPermit
impl UnwindSafe for ToolExecutionPermit
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