pub struct ActionRegsGuard;Expand description
Empty RAII guard — vestigial after MG.13.
It used to hold a Vec<ActionHandlerRegistration>, and its doc
comment already named the hazard that motivated MG.13: “two buffers
of the same major mode open at once silently let the second’s
on_activate replace the first’s handler (registry is
last-write-wins per CommandId), so firing the chord in buffer A
can execute buffer B’s captured state against A’s cursor.”
Holding the tokens bounded the damage — the guard unregistered on
close — but could not prevent it, because the registry has no buffer
dimension: two live registrations of one CommandId cannot coexist
no matter who owns the tokens. MG.13 removes the hazard at the
source instead: every magit handler is registered once at boot
via Mode::action_handlers() and resolves per-buffer state from a
service at call time, so there is nothing per-activation left to
unwind. Kept only because Mode requires an associated Guard.
Trait Implementations§
Source§impl Default for ActionRegsGuard
impl Default for ActionRegsGuard
Source§fn default() -> ActionRegsGuard
fn default() -> ActionRegsGuard
Auto Trait Implementations§
impl Freeze for ActionRegsGuard
impl RefUnwindSafe for ActionRegsGuard
impl Send for ActionRegsGuard
impl Sync for ActionRegsGuard
impl Unpin for ActionRegsGuard
impl UnsafeUnpin for ActionRegsGuard
impl UnwindSafe for ActionRegsGuard
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
§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