#[non_exhaustive]pub struct PermissionRequest<'a> {
pub tool_name: &'a str,
pub tool: Option<&'a Arc<dyn Tool>>,
pub input: &'a Value,
pub facts: &'a ToolFacts,
pub ctx: &'a ToolContext,
pub session: &'a Arc<dyn Session>,
pub delegate: Option<Delegate<'a>>,
pub hook: &'a HookAnswer,
pub attendance: Attendance,
}Expand description
One tool call put to a PermissionPolicy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tool_name: &'a str§tool: Option<&'a Arc<dyn Tool>>The tool the call dispatches to, looked up in the registry dispatch
uses. None is a name nothing answers to.
input: &'a Value§facts: &'a ToolFactsWhat the tool says about the call, gathered with ctx.
ctx: &'a ToolContextThe context the call runs with: the judged session’s.
session: &'a Arc<dyn Session>The live state of the session the policy belongs to: its permission mode as it is now, what it has read.
delegate: Option<Delegate<'a>>Set when the call is a delegate’s — a sub-agent’s, a team member’s — relayed to this session’s policy.
hook: &'a HookAnswer§attendance: AttendanceImplementations§
Source§impl<'a> PermissionRequest<'a>
impl<'a> PermissionRequest<'a>
Sourcepub fn new(
tool_name: &'a str,
tool: Option<&'a Arc<dyn Tool>>,
input: &'a Value,
facts: &'a ToolFacts,
ctx: &'a ToolContext,
session: &'a Arc<dyn Session>,
) -> Self
pub fn new( tool_name: &'a str, tool: Option<&'a Arc<dyn Tool>>, input: &'a Value, facts: &'a ToolFacts, ctx: &'a ToolContext, session: &'a Arc<dyn Session>, ) -> Self
A call no hook answered, as attended as ctx says.
pub fn for_delegate(self, delegate: Delegate<'a>) -> Self
pub fn with_hook(self, hook: &'a HookAnswer) -> Self
pub fn with_attendance(self, attendance: Attendance) -> Self
Trait Implementations§
Source§impl<'a> Clone for PermissionRequest<'a>
impl<'a> Clone for PermissionRequest<'a>
impl<'a> Copy for PermissionRequest<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PermissionRequest<'a>
impl<'a> !UnwindSafe for PermissionRequest<'a>
impl<'a> Forget for PermissionRequest<'a>
impl<'a> Freeze for PermissionRequest<'a>
impl<'a> Move for PermissionRequest<'a>
impl<'a> Send for PermissionRequest<'a>
impl<'a> Sync for PermissionRequest<'a>where
Arc<dyn Tool>: Sync,
RawVecInner: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
Arc<TreeNode>: Sync,
Arc<EngineConfig>: Sync,
Arc<dyn Session>: Sync,
Arc<dyn Elicitation>: Sync,
Arc<dyn HostCalls>: Sync,
Arc<dyn Process>: Sync,
Arc<dyn FileSystem>: Sync,
Arc<dyn Network>: Sync,
Arc<dyn Sandbox>: Sync,
Arc<dyn ToolDispatch>: Sync,
Arc<EngineExec>: Sync,
Arc<TurnScope>: Sync,
Arc<dyn InlineCommands>: Sync,
Arc<dyn PathDenials>: Sync,
impl<'a> Unpin for PermissionRequest<'a>
impl<'a> UnsafeUnpin for PermissionRequest<'a>where
&'a str: UnsafeUnpin,
&'a Arc<dyn Tool>: UnsafeUnpin,
&'a Value: UnsafeUnpin,
&'a ToolFacts: UnsafeUnpin,
&'a ToolContext: UnsafeUnpin,
&'a Arc<dyn Session>: UnsafeUnpin,
&'a [PermissionRule]: UnsafeUnpin,
&'a HookAnswer: UnsafeUnpin,
&'static str: 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