pub struct PermissionQueue { /* private fields */ }Expand description
权限请求队列(主 TUI 和所有 agent 线程共享同一个 Arc 实例)
Implementations§
Source§impl PermissionQueue
impl PermissionQueue
pub fn new() -> Self
Sourcepub fn request_blocking(&self, req: Arc<PendingAgentPerm>) -> bool
pub fn request_blocking(&self, req: Arc<PendingAgentPerm>) -> bool
派生 Agent 线程调用:把请求加入队列并阻塞等待(最长 [AGENT_PERM_TIMEOUT_SECS] 秒)。
返回 true 表示用户批准,false 表示拒绝或超时。
Sourcepub fn pop_pending(&self) -> Option<Arc<PendingAgentPerm>>
pub fn pop_pending(&self) -> Option<Arc<PendingAgentPerm>>
TUI 循环调用:取出下一个待决请求(非阻塞)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PermissionQueue
impl RefUnwindSafe for PermissionQueue
impl Send for PermissionQueue
impl Sync for PermissionQueue
impl Unpin for PermissionQueue
impl UnsafeUnpin for PermissionQueue
impl UnwindSafe for PermissionQueue
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.