pub struct MagitActionIds { /* private fields */ }Expand description
MG.41a: every registered magit action, keyed by its registered name.
Replaces the per-row Option<CommandId> struct field. Adding a
transient row used to mean editing four places that had to stay in
sync — register_action_commands, a struct field, a
resolve_dispatch_ids line, and the builder — none of which failed
to compile when they drifted; the row just silently rendered as a
disabled placeholder. With rows naming their command directly, two
of those four disappear.
Resolution is automatic. resolve scans the registry for every
action:magit- name rather than reading a hand-kept list, so there
is no third enumeration hiding here either: registering an action is
the only step, and a row referencing it works immediately.
The cost is losing compile-time field checking. Mitigated the way
this repo already mitigates it for the <C-h> help prefix: a test
asserts every name any row references actually resolves, so drift
fails loudly instead of rendering a placeholder.
Implementations§
Trait Implementations§
Source§impl Clone for MagitActionIds
impl Clone for MagitActionIds
Source§fn clone(&self) -> MagitActionIds
fn clone(&self) -> MagitActionIds
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MagitActionIds
impl Debug for MagitActionIds
Source§impl Default for MagitActionIds
impl Default for MagitActionIds
Source§fn default() -> MagitActionIds
fn default() -> MagitActionIds
Auto Trait Implementations§
impl Freeze for MagitActionIds
impl RefUnwindSafe for MagitActionIds
impl Send for MagitActionIds
impl Sync for MagitActionIds
impl Unpin for MagitActionIds
impl UnsafeUnpin for MagitActionIds
impl UnwindSafe for MagitActionIds
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more