pub struct WasmDecorationState {
pub cache: PerBufferCache<WasmGutterDecorationCache>,
pub registry: Option<GutterDecorationSourceRegistryHandle>,
pub generation: Arc<AtomicU64>,
/* private fields */
}Expand description
The Editor’s cohesive WASM-decoration wiring (PL8.E). Bundled into one
field so the boot struct literal grows by a single line and the state stays
together. Every field defaults (empty cache / no registry / generation 0),
so Editor::default() test fixtures get an inert decoration seam.
Fields§
§cache: PerBufferCache<WasmGutterDecorationCache>Per-buffer cache the producer tasks write and the renderer reads. Cloned
into the published RenderState so off-render-path writes are observed
without republishing the snapshot.
registry: Option<GutterDecorationSourceRegistryHandle>The registered async decoration producers — a clone of the boot
GutterDecorationSourceRegistryHandle service the loader RCU-registers
into. None in Editor::default(); the refresh then no-ops.
generation: Arc<AtomicU64>Off-keystroke paint gate. A producer task bumps this on every cache
write; Editor::compute_paint_revision folds it in so
a decoration arrival with no keystroke in flight repaints the gutter.
Implementations§
Source§impl WasmDecorationState
impl WasmDecorationState
Sourcepub fn with_registry(registry: GutterDecorationSourceRegistryHandle) -> Self
pub fn with_registry(registry: GutterDecorationSourceRegistryHandle) -> Self
Construct the decoration state wired to the boot producer registry — the
boot path. Keeps the single-flight / epoch bookkeeping private (they
start zeroed); Editor::default() uses the Default impl (no registry).
Sourcepub fn request_refresh(&self)
pub fn request_refresh(&self)
SG.1 / DR.2: force the next tick to re-ask every producer.
:redraw / <C-l> is the user’s escape hatch for a display that has
gone wrong, and it already re-derives every visible pane from a clean
slate. A cached decoration set is part of that display: without this a
stale sign — the one thing <C-l> exists to fix — survives the redraw,
because the pump’s two ordinary triggers (registry, document version)
are both unchanged by a redraw.
A no-op when no counter is wired, like every other degradation here.
Sourcepub fn with_decoration_epoch(self, epoch: DecorationEpochHandle) -> Self
pub fn with_decoration_epoch(self, epoch: DecorationEpochHandle) -> Self
OA.30: attach the guest-driven refresh counter. Separate from
with_registry because a harness may wire one
without the other, and neither is a precondition for the other working.
Trait Implementations§
Source§impl Debug for WasmDecorationState
impl Debug for WasmDecorationState
Source§impl Default for WasmDecorationState
impl Default for WasmDecorationState
Source§fn default() -> WasmDecorationState
fn default() -> WasmDecorationState
Auto Trait Implementations§
impl !RefUnwindSafe for WasmDecorationState
impl !UnwindSafe for WasmDecorationState
impl Freeze for WasmDecorationState
impl Send for WasmDecorationState
impl Sync for WasmDecorationState
impl Unpin for WasmDecorationState
impl UnsafeUnpin for WasmDecorationState
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
§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