pub struct ApprovalResolver { /* private fields */ }Expand description
Resolves pending tool approvals by matching decision ids to waiting receivers. Cloneable so it can be handed to the UI layer.
Implementations§
Source§impl ApprovalResolver
impl ApprovalResolver
Sourcepub fn register(&self, id: String) -> Receiver<ApprovalDecision>
pub fn register(&self, id: String) -> Receiver<ApprovalDecision>
Register a pending approval, returning the receiver for the decision.
Sourcepub fn resolve(&self, decision: ApprovalDecision) -> bool
pub fn resolve(&self, decision: ApprovalDecision) -> bool
Resolves a pending approval by id. Returns true if a matching
pending request was found and resolved.
Trait Implementations§
Source§impl Clone for ApprovalResolver
impl Clone for ApprovalResolver
Source§fn clone(&self) -> ApprovalResolver
fn clone(&self) -> ApprovalResolver
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 moreAuto Trait Implementations§
impl Freeze for ApprovalResolver
impl RefUnwindSafe for ApprovalResolver
impl Send for ApprovalResolver
impl Sync for ApprovalResolver
impl Unpin for ApprovalResolver
impl UnsafeUnpin for ApprovalResolver
impl UnwindSafe for ApprovalResolver
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