pub struct SessionApproval { /* private fields */ }Expand description
One session’s active approval policy and its remembered answers.
Cloneable and shared: a dispatch loop may switch the mode while a spawned turn reads it. The lock is sync and never held across an await.
Implementations§
Source§impl SessionApproval
impl SessionApproval
Sourcepub fn new(initial: ApprovalPolicy) -> Self
pub fn new(initial: ApprovalPolicy) -> Self
Opens a session at initial.
pub fn current(&self) -> ApprovalPolicy
Sourcepub fn set(&self, policy: ApprovalPolicy)
pub fn set(&self, policy: ApprovalPolicy)
Sets the policy and forgets every session-scoped answer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionApproval
impl RefUnwindSafe for SessionApproval
impl Send for SessionApproval
impl Sync for SessionApproval
impl Unpin for SessionApproval
impl UnsafeUnpin for SessionApproval
impl UnwindSafe for SessionApproval
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