pub struct FrictionGate<D: GateableDirection> { /* private fields */ }Expand description
A gate applied in front of a command. The generic D binds to
RiskDirection at the type level so only risk-increasing
commands can be gated.
Implementations§
Source§impl FrictionGate<Increases>
impl FrictionGate<Increases>
Sourcepub const fn new(level: FrictionLevel) -> Self
pub const fn new(level: FrictionLevel) -> Self
Construct a gate from a friction level.
pub const fn level(&self) -> FrictionLevel
Sourcepub const fn requires_typed_confirm(&self) -> bool
pub const fn requires_typed_confirm(&self) -> bool
Whether the confirmation must be typed-word rather than single-key.
Trait Implementations§
Source§impl<D: Clone + GateableDirection> Clone for FrictionGate<D>
impl<D: Clone + GateableDirection> Clone for FrictionGate<D>
Source§fn clone(&self) -> FrictionGate<D>
fn clone(&self) -> FrictionGate<D>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<D: Debug + GateableDirection> Debug for FrictionGate<D>
impl<D: Debug + GateableDirection> Debug for FrictionGate<D>
impl<D: Copy + GateableDirection> Copy for FrictionGate<D>
Auto Trait Implementations§
impl<D> Freeze for FrictionGate<D>
impl<D> RefUnwindSafe for FrictionGate<D>where
D: RefUnwindSafe,
impl<D> Send for FrictionGate<D>where
D: Send,
impl<D> Sync for FrictionGate<D>where
D: Sync,
impl<D> Unpin for FrictionGate<D>where
D: Unpin,
impl<D> UnsafeUnpin for FrictionGate<D>
impl<D> UnwindSafe for FrictionGate<D>where
D: UnwindSafe,
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