#[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>
impl<'a> Unpin for PermissionRequest<'a>
impl<'a> UnsafeUnpin for PermissionRequest<'a>
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