pub enum ModeEvent {
ModeActivationFailed {
buffer: BufferId,
mode: ModeId,
reason: String,
},
OptionConflict {
buffer: BufferId,
option: &'static str,
modes: SmallVec<[ModeId; 2]>,
},
}Expand description
Internal mode-dispatch signals on the typed event bus
(ModeActivationFailed / OptionConflict). The observable
lifecycle quartet lives on the [lattice_protocol::Event] enum
(MA.1) — see the module docs.
Variants§
ModeActivationFailed
on_activate returned Err. Published from
the spawned lifecycle task instead of the success lifecycle
event. active_modes was mutated
synchronously by the dispatcher’s sync prefix; M-async.3
adds an App-side subscriber that rolls back on this
event. reason is the boundary string of the original
ModeActivationError (the error type itself isn’t Eq /
Clone-friendly across crate boundaries; the string is
what subscribers actually use) (M-async.2).
Fields
buffer: BufferIdThe buffer the activation targeted.
OptionConflict
Two active minor modes contributed conflicting values for the same option. Reserved: declared for M.2’s resolver, but nothing publishes it today.
Implementations§
Source§impl ModeEvent
impl ModeEvent
Sourcepub fn activation_failed(
buffer: BufferId,
mode: ModeId,
err: &ModeActivationError,
) -> Self
pub fn activation_failed( buffer: BufferId, mode: ModeId, err: &ModeActivationError, ) -> Self
Build a ModeActivationFailed from a
ModeActivationError. Stringifies the error so the
event payload is Clone + Eq (the error variants
contain registry-internal types that aren’t worth
threading through every subscriber).
Trait Implementations§
impl Eq for ModeEvent
Source§impl Event for ModeEvent
impl Event for ModeEvent
Source§fn event_type_id(&self) -> EventTypeId
fn event_type_id(&self) -> EventTypeId
static to avoid
re-allocating the metadata on every call. The macro
register_event! generates this for you.impl StructuralPartialEq for ModeEvent
Auto Trait Implementations§
impl Freeze for ModeEvent
impl RefUnwindSafe for ModeEvent
impl Send for ModeEvent
impl Sync for ModeEvent
impl Unpin for ModeEvent
impl UnsafeUnpin for ModeEvent
impl UnwindSafe for ModeEvent
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.