#[non_exhaustive]pub enum ApprovalStatus {
NotApplicable,
Approved {
reason: Option<String>,
},
Denied {
reason: Option<String>,
},
UserApproval {
reason: Option<String>,
},
}Expand description
Outcome of approval resolution for one tool call.
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.
NotApplicable
No approval needed; the tool executes directly.
Approved
Approved automatically; the tool executes and the decision is recorded.
Denied
Denied automatically; the tool does not execute.
UserApproval
An external approver must decide; the loop stops with an approval request.
Implementations§
Source§impl ApprovalStatus
impl ApprovalStatus
Sourcepub fn user_approval() -> Self
pub fn user_approval() -> Self
User approval without reason.
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Attaches a reason (ignored for NotApplicable).
Trait Implementations§
Source§impl ApprovalPolicy for ApprovalStatus
impl ApprovalPolicy for ApprovalStatus
Source§fn resolve<'a>(
&'a self,
_call: &'a ParsedToolCall,
_ctx: ApprovalContext<'a>,
) -> BoxFuture<'a, Option<ApprovalStatus>>
fn resolve<'a>( &'a self, _call: &'a ParsedToolCall, _ctx: ApprovalContext<'a>, ) -> BoxFuture<'a, Option<ApprovalStatus>>
Resolves the approval status of
call.Source§impl Clone for ApprovalStatus
impl Clone for ApprovalStatus
Source§fn clone(&self) -> ApprovalStatus
fn clone(&self) -> ApprovalStatus
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 ApprovalStatus
impl Debug for ApprovalStatus
Source§impl<'de> Deserialize<'de> for ApprovalStatus
impl<'de> Deserialize<'de> for ApprovalStatus
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 ApprovalStatus
Source§impl PartialEq for ApprovalStatus
impl PartialEq for ApprovalStatus
Source§impl Serialize for ApprovalStatus
impl Serialize for ApprovalStatus
impl StructuralPartialEq for ApprovalStatus
Auto Trait Implementations§
impl Freeze for ApprovalStatus
impl RefUnwindSafe for ApprovalStatus
impl Send for ApprovalStatus
impl Sync for ApprovalStatus
impl Unpin for ApprovalStatus
impl UnsafeUnpin for ApprovalStatus
impl UnwindSafe for ApprovalStatus
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.