pub struct SignsRenderState {
pub registry: Arc<SignRegistry>,
pub elements: Arc<HashMap<SignId, ElementId>>,
pub builtin: BuiltinSignIds,
}Expand description
SG.2b — everything a renderer needs to paint a GutterDecoration::Sign,
resolved on the actor thread so the render path does neither a string
hash nor a theme lookup by name.
A placement carries a lattice_mode::SignId; painting it needs the
definition (for the glyph) and a crate::ui::theme::ElementId (for the
colour). The id is what the theme’s by_name map answers, and asking it
per placed line per frame would put a HashMap<String, _> probe on the
hot path to re-derive something that changes only when a sign is defined
or a theme is loaded. So it is resolved once, here.
Rebuilt every publish rather than version-cached, deliberately: the map is keyed by definitions, of which there are single digits (a provider registers its vocabulary at load), not by placements, of which there is one per visible marked line. Caching it would need an invalidation axis folding the sign registry’s version AND the theme’s, and a missed bump there paints a stale glyph in the wrong colour — the failure mode is silent and the saving is a handful of string hashes on the publish path.
Fields§
§registry: Arc<SignRegistry>The definition snapshot. get(id) answers None for a retired id,
which paints nothing.
elements: Arc<HashMap<SignId, ElementId>>SignId → the element its theme_element names, for the ids whose
element is actually registered. Absent means fall back to
gutter.sign — a plugin that shipped a sign without its element,
or one whose theme has not been reloaded. That fallback is SG.2b’s
whole point: a sign was placed to say something, and painting it
invisibly is the one outcome that loses the information entirely.
builtin: BuiltinSignIdsSG.4b: the interned built-in sign ids, so a renderer can hand them to
the decoration context without reaching into Editor — GPUI reads only
this published snapshot, and a renderer that had to reach further would
be the seam leaking.
Trait Implementations§
Source§impl Clone for SignsRenderState
impl Clone for SignsRenderState
Source§fn clone(&self) -> SignsRenderState
fn clone(&self) -> SignsRenderState
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 SignsRenderState
impl Debug for SignsRenderState
Source§impl Default for SignsRenderState
impl Default for SignsRenderState
Source§fn default() -> SignsRenderState
fn default() -> SignsRenderState
Auto Trait Implementations§
impl Freeze for SignsRenderState
impl RefUnwindSafe for SignsRenderState
impl Send for SignsRenderState
impl Sync for SignsRenderState
impl Unpin for SignsRenderState
impl UnsafeUnpin for SignsRenderState
impl UnwindSafe for SignsRenderState
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