pub enum PermissionResult {
Decision(PermissionDecision),
NoResult,
}Expand description
Decision returned by a PermissionHandler.
Either a concrete wire-level PermissionDecision (approve, reject,
approve-for-session, approve-permanently, user-not-available, …) or
PermissionResult::NoResult, which tells the SDK to suppress its
response so another connected client can answer instead.
Variants§
Decision(PermissionDecision)
Send a permission decision on the wire.
NoResult
Decline to respond to this request, allowing another connected client to answer instead. The SDK suppresses the response.
Implementations§
Source§impl PermissionResult
impl PermissionResult
Sourcepub fn approve_once() -> Self
pub fn approve_once() -> Self
Approve this single request.
Sourcepub fn reject(feedback: impl Into<Option<String>>) -> Self
pub fn reject(feedback: impl Into<Option<String>>) -> Self
Reject the request, optionally forwarding feedback to the LLM.
Sourcepub fn user_not_available() -> Self
pub fn user_not_available() -> Self
Deny because no user is available to confirm.
Trait Implementations§
Source§impl Clone for PermissionResult
impl Clone for PermissionResult
Source§fn clone(&self) -> PermissionResult
fn clone(&self) -> PermissionResult
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 PermissionResult
impl Debug for PermissionResult
Source§impl From<PermissionDecision> for PermissionResult
impl From<PermissionDecision> for PermissionResult
Source§fn from(value: PermissionDecision) -> Self
fn from(value: PermissionDecision) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PermissionResult
impl RefUnwindSafe for PermissionResult
impl Send for PermissionResult
impl Sync for PermissionResult
impl Unpin for PermissionResult
impl UnsafeUnpin for PermissionResult
impl UnwindSafe for PermissionResult
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