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§
Source§impl Clone for SessionApproval
impl Clone for SessionApproval
Source§fn clone(&self) -> SessionApproval
fn clone(&self) -> SessionApproval
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 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