#[non_exhaustive]pub enum PolicyDecision {
Allow,
Deny,
Ask(Ask),
}Expand description
The decision result.
Ask::options must be assembled by the policy itself (including the prompt text, wire
id, and allows).
The main loop no longer infers whether to allow for
PermissionOptionKind::AllowOnce / RejectOnce, etc. — that is the policy’s
semantics.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Allow
Allow the action without prompting the user.
Deny
Deny directly; the main loop feeds “denied by policy” back to the LLM as a
tool_result.
Ask(Ask)
Requires user confirmation. The main loop fires ACP session/request_permission
and waits for the user to pick an item from Ask::options.
Trait Implementations§
Source§impl Clone for PolicyDecision
impl Clone for PolicyDecision
Source§fn clone(&self) -> PolicyDecision
fn clone(&self) -> PolicyDecision
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 PolicyDecision
impl Debug for PolicyDecision
Source§impl<'de> Deserialize<'de> for PolicyDecision
impl<'de> Deserialize<'de> for PolicyDecision
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PolicyDecision
Source§impl PartialEq for PolicyDecision
impl PartialEq for PolicyDecision
Source§fn eq(&self, other: &PolicyDecision) -> bool
fn eq(&self, other: &PolicyDecision) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PolicyDecision
impl Serialize for PolicyDecision
impl StructuralPartialEq for PolicyDecision
Auto Trait Implementations§
impl Freeze for PolicyDecision
impl RefUnwindSafe for PolicyDecision
impl Send for PolicyDecision
impl Sync for PolicyDecision
impl Unpin for PolicyDecision
impl UnsafeUnpin for PolicyDecision
impl UnwindSafe for PolicyDecision
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