Skip to main content

push_coalesced

Function push_coalesced 

Source
pub fn push_coalesced(queue: &mut VecDeque<Event>, event: Event) -> bool
Expand description

Appends event to queue, replacing the tail in place instead of growing the queue when coalesces_with says the two coalesce.

The sole enforcement point for the coalescing rule: every backend-owned event queue (Headless, retroglyph-window’s WindowBackend, retroglyph-software’s SoftwareRenderer, retroglyph-terminal-wasm’s TerminalWasm) should push through this rather than re-checking coalesces_with against its own tail. Terminal::requeue_events deliberately does not use this: it replays already-drained events back onto the queue in order, where coalescing them again would silently drop events a caller already observed.

Returns true if event replaced the tail, false if it was pushed onto the queue.