pub enum RendererSignal {
ThemeChanged,
Quit,
NerdFontsToggled,
LspConfigChanged(String),
DisplayBuffer(Box<DisplayBufferRequest>),
}Expand description
Host-to-renderer side-effect signal.
v1 scope is deliberately small (see
phase-5-dispatch-extraction.md §“RendererSignal scope”). Only
variants with planned emission sites in the existing dispatch
path are included; speculative variants (Repaint,
TitleChanged) are deferred until a real need surfaces.
The renderer matches on this in its post-dispatch hook:
let outcome = self.editor.dispatch(action);
for signal in outcome.renderer_signals {
match signal {
RendererSignal::ThemeChanged => self.rebuild_renderer_theme(),
RendererSignal::Quit => self.shutdown(),
}
}First emission sites land in sub-slices 5.5.C (Self::Quit)
and 5.5.E (Self::ThemeChanged); the variants exist from
5.5.A so the type surface is fixed before any consumer composes
against it.
Variants§
ThemeChanged
The host’s neutral [crate::ui::theme::Theme] changed
(typically via a :set ui.* cascade). The renderer should
rebuild its cached typed theme mirror.
Quit
Quit requested. The renderer should begin its shutdown
sequence. editor.should_quit is also set for back-compat
with renderers that poll per-tick.
NerdFontsToggled
5.5.E.6: the ui.nerd_fonts cascade flipped the
nerd-fonts toggle. The TUI’s file-tree rope embeds the
icon glyphs, so a palette flip needs a per-file-tree-buffer
rope refresh on the renderer side; oil’s renderer reads the
toggle each frame and needs no rope-side work. The host
emits this in addition to Self::ThemeChanged so
renderers that don’t track file-tree state can ignore it
without missing the theme rebuild.
LspConfigChanged(String)
5.5.E.6: the option-cascade just touched an
lsp.<server_id>.* key. The renderer fans out a
workspace/didChangeConfiguration to every actor matching
server_id with the freshly merged subtree. The host
can’t drive this without owning the LSP actor pool, which
stays renderer-side through 5.5.
DisplayBuffer(Box<DisplayBufferRequest>)
5.5.F.1: a host-side do_* arm built a lattice_help::HelpContent
and wants the renderer to display it under a given category
(e.g. Effect::ListBuffers → HelpList,
Effect::DescribeBuffer → HelpDescribe). The renderer
runs its existing display_buffer dispatch: resolve the
category to a lattice_core::ui::display::BufferDisplay
preference, then route into the matching surface (popup,
active-pane swap, split). Boxed because lattice_help::HelpContent
is ~6 fields including a parsed markdown highlight cache,
and most signals don’t carry one — keeping the variant
small keeps the common-case Vec<RendererSignal> cheap.
PartialEq / Eq derives drop on RendererSignal because
lattice_help::HelpContent doesn’t implement them (the
syntax-highlight cache is renderer-neutral but not value-
equatable). Signals are produced at : / Effect-arm rate,
not per-frame, so the Box allocation is well below any
perf gate.
Trait Implementations§
Source§impl Clone for RendererSignal
impl Clone for RendererSignal
Source§fn clone(&self) -> RendererSignal
fn clone(&self) -> RendererSignal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RendererSignal
impl RefUnwindSafe for RendererSignal
impl Send for RendererSignal
impl Sync for RendererSignal
impl Unpin for RendererSignal
impl UnsafeUnpin for RendererSignal
impl UnwindSafe for RendererSignal
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for 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