pub struct Yolo(/* private fields */);Expand description
Whether tools may run without asking, for as long as this process lives.
Cloned into both front ends and read per turn; the atomic is the whole point, because the
toggle is handled in the same match that answers a turn, several frames below the loop that
chose the policy.
Implementations§
Source§impl Yolo
impl Yolo
pub fn new(on: bool) -> Self
pub fn set(&self, on: bool)
Sourcepub fn apply(&self, arg: &str) -> Result<String, String>
pub fn apply(&self, arg: &str) -> Result<String, String>
/yolo with no argument toggles; on and off set. Err is what the caller shows for a
word that is not one of them, and nothing was changed.
The Ok text names the state that is now in force rather than the transition, because a
toggle’s answer has to be readable without knowing what it was before.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Yolo
impl Freeze for Yolo
impl Move for Yolo
impl RefUnwindSafe for Yolo
impl Send for Yolo
impl Sync for Yolo
impl Unpin for Yolo
impl UnsafeUnpin for Yolowhere
*const ArcInner<Atomic<bool>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin,
impl UnwindSafe for Yolo
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