nushell/crates/nu-command/src/bytes
Ian Manske 399a7c8836
Add and use new Signals struct (#13314)
# Description
This PR introduces a new `Signals` struct to replace our adhoc passing
around of `ctrlc: Option<Arc<AtomicBool>>`. Doing so has a few benefits:
- We can better enforce when/where resetting or triggering an interrupt
is allowed.
- Consolidates `nu_utils::ctrl_c::was_pressed` and other ad-hoc
re-implementations into a single place: `Signals::check`.
- This allows us to add other types of signals later if we want. E.g.,
exiting or suspension.
- Similarly, we can more easily change the underlying implementation if
we need to in the future.
- Places that used to have a `ctrlc` of `None` now use
`Signals::empty()`, so we can double check these usages for correctness
in the future.
2024-07-07 22:29:01 +00:00
..
add.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
at.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
build_.rs Revert "Span ID Refactor (Step 2): Make Call SpanId-friendly (#13268)" (#13292) 2024-07-04 00:02:13 +03:00
bytes_.rs Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
collect.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
ends_with.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
index_of.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
length.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
mod.rs move 'bytes' back to commands (#10051) 2023-08-19 22:43:53 +02:00
remove.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
replace.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
reverse.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
starts_with.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00