pub struct RequestGuard<'a, Req, Resp>{ /* private fields */ }Expand description
Request guard that enforces B must reply
This guard ensures that B must call reply() before dropping the guard.
If the guard is dropped without replying, it will panic to prevent A from deadlocking.
强制 B 必须回复的 Guard
这个 guard 确保 B 必须在丢弃 guard 之前调用 reply()。
如果 guard 在没有回复的情况下被丢弃,会 panic 以防止 A 死锁。
Implementations§
Source§impl<'a, Req, Resp> RequestGuard<'a, Req, Resp>
impl<'a, Req, Resp> RequestGuard<'a, Req, Resp>
Trait Implementations§
Source§impl<'a, Req, Resp> Debug for RequestGuard<'a, Req, Resp>
impl<'a, Req, Resp> Debug for RequestGuard<'a, Req, Resp>
Source§impl<'a, Req, Resp> Drop for RequestGuard<'a, Req, Resp>
Drop guard: If B drops the guard without calling reply, we panic.
This enforces the “must reply” protocol.
impl<'a, Req, Resp> Drop for RequestGuard<'a, Req, Resp>
Drop guard: If B drops the guard without calling reply, we panic.
This enforces the “must reply” protocol.
Drop 守卫:如果 B 不调用 reply 就丢弃了 Guard,我们会 panic。
这强制执行了 “必须回复” 的协议。
Source§impl<'a, Req, Resp> PartialEq for RequestGuard<'a, Req, Resp>
impl<'a, Req, Resp> PartialEq for RequestGuard<'a, Req, Resp>
Auto Trait Implementations§
impl<'a, Req, Resp> Freeze for RequestGuard<'a, Req, Resp>where
Req: Freeze,
impl<'a, Req, Resp> !RefUnwindSafe for RequestGuard<'a, Req, Resp>
impl<'a, Req, Resp> Send for RequestGuard<'a, Req, Resp>
impl<'a, Req, Resp> Sync for RequestGuard<'a, Req, Resp>where
Req: Sync,
impl<'a, Req, Resp> Unpin for RequestGuard<'a, Req, Resp>where
Req: Unpin,
impl<'a, Req, Resp> !UnwindSafe for RequestGuard<'a, Req, Resp>
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