Skip to main content

DecorationEpoch

Struct DecorationEpoch 

Source
pub struct DecorationEpoch(/* private fields */);
Expand description

The counter a guest bumps to say “my decorations changed, though the document did not” (OA.30).

§The hole this fills

maybe_refresh_wasm_decorations re-runs producers on exactly two triggers: the producer registry changed, or this buffer’s cached document_version moved. Both are about things the HOST can see. A producer whose output depends on its own view-local state — the agenda’s bulk marks are the case that found this — changes neither, so its first answer is cached forever and every later toggle paints nothing.

That is the same shape refresh-view (OA.15a) closed one level up: a guest could compute a new answer and had no way to say so. This is the gutter’s version of it.

§Why a bare counter, and not a per-buffer map

The refresh pump only ever refetches the ACTIVE buffer, so a bump means “the next tick should refetch” and nothing finer would be read. A per-buffer key would be a more precise answer to a question nobody asks, and the cost of being coarse is one extra producer call — off the actor thread, on a tick, for a buffer that is on screen anyway.

Implementations§

Source§

impl DecorationEpoch

Source

pub fn bump(&self)

Say that a producer’s answer has changed. Cheap enough to call per keystroke: one relaxed increment.

Source

pub fn get(&self) -> u64

The current value, for the refresh gate to compare against its last.

Trait Implementations§

Source§

impl Debug for DecorationEpoch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DecorationEpoch

Source§

fn default() -> DecorationEpoch

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more