pub struct PermissionReviewRequest { /* private fields */ }Expand description
A pending host-facing permission review request.
Implementations§
Source§impl PermissionReviewRequest
impl PermissionReviewRequest
Sourcepub fn request(&self) -> &PermissionRequest
pub fn request(&self) -> &PermissionRequest
Returns the request that must be shown to the host.
Sourcepub const fn actor(&self) -> &PermissionActor
pub const fn actor(&self) -> &PermissionActor
Returns the actor identity (main agent or specific subagent) requesting permission.
Sourcepub fn approval_id(&self) -> String
pub fn approval_id(&self) -> String
Returns the stable response correlation id.
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Returns the exact request fingerprint required in a response.
Sourcepub const fn host_fallback_reason(&self) -> Option<&HostFallbackReason>
pub const fn host_fallback_reason(&self) -> Option<&HostFallbackReason>
Returns why AI review handed this request to the host, when it did.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns whether the runtime cancelled this pending review.
Sourcepub fn approve(
self,
rationale: impl Into<String>,
) -> Result<(), PermissionReviewResponseError>
pub fn approve( self, rationale: impl Into<String>, ) -> Result<(), PermissionReviewResponseError>
Resolves this request as an approval.
Sourcepub fn deny(
self,
rationale: impl Into<String>,
) -> Result<(), PermissionReviewResponseError>
pub fn deny( self, rationale: impl Into<String>, ) -> Result<(), PermissionReviewResponseError>
Resolves this request as a denial.
Sourcepub fn respond(
self,
response: PermissionReviewResponse,
) -> Result<(), PermissionReviewResponseError>
pub fn respond( self, response: PermissionReviewResponse, ) -> Result<(), PermissionReviewResponseError>
Sends a response, including its caller-supplied correlation fields.
The runtime validates both fields before it can grant the request, so a stale UI response cannot authorize a later call.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PermissionReviewRequest
impl !UnwindSafe for PermissionReviewRequest
impl Forget for PermissionReviewRequest
impl Freeze for PermissionReviewRequestwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<RequestedCapability>: Freeze,
PhantomData<String>: Freeze,
PhantomData<PermissionReviewContextEntry>: Freeze,
*const ArcInner<TreeNode> is !null: Freeze,
PhantomData<ArcInner<TreeNode>>: Freeze,
*const ArcInner<Inner<PermissionReviewResponse>> is !null: Freeze,
PhantomData<ArcInner<Inner<PermissionReviewResponse>>>: Freeze,
impl Move for PermissionReviewRequest
impl Send for PermissionReviewRequest
impl Sync for PermissionReviewRequest
impl Unpin for PermissionReviewRequest
impl UnsafeUnpin for PermissionReviewRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<RequestedCapability>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<PermissionReviewContextEntry>: UnsafeUnpin,
*const ArcInner<TreeNode> is !null: UnsafeUnpin,
PhantomData<ArcInner<TreeNode>>: UnsafeUnpin,
*const ArcInner<Inner<PermissionReviewResponse>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner<PermissionReviewResponse>>>: UnsafeUnpin,
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