Skip to main content

assert_cursor_style_contract

Function assert_cursor_style_contract 

Source
pub fn assert_cursor_style_contract<B: Observable + Cursor, F: FnMut(Size) -> B>(
    make: F,
)
Expand description

Drives B through Cursor::set_cursor_style’s obligation: each CursorStyle variant must have its own distinct, observable effect (retroglyph#920).

crossterm and terminal-wasm each map every CursorStyle variant to a DECSCUSR parameter via their own independent match, with no shared source of truth between the two; this assertion doesn’t compare backends against each other (their emitted bytes differ by design), but it does pin, once per backend, that the six variants aren’t accidentally collapsed onto fewer than six distinct behaviors (e.g. two arms sharing a fallthrough).

§Panics

Panics if two distinct CursorStyle variants produce the same digest, or if any Output call returns Err.