Raxol.Terminal.Emulator.Adapter (Raxol v2.0.1)

View Source

Adapter module to make EmulatorLite compatible with existing code that expects the full Emulator struct.

This module provides conversion functions and compatibility shims.

Summary

Functions

Ensures we have an Emulator struct, converting from EmulatorLite if needed.

Ensures we have an EmulatorLite struct, converting from Emulator if needed.

Converts an EmulatorLite to an Emulator struct for compatibility.

is_lite?(emulator) deprecated

Checks if an emulator is the lite version (no GenServers).

Converts a full Emulator to EmulatorLite, discarding GenServer references.

Functions

ensure_emulator(emulator)

Ensures we have an Emulator struct, converting from EmulatorLite if needed.

This is a compatibility function for code that expects Emulator structs.

ensure_lite(lite)

Ensures we have an EmulatorLite struct, converting from Emulator if needed.

This is useful for performance-critical paths that don't need GenServers.

from_lite(lite)

Converts an EmulatorLite to an Emulator struct for compatibility.

Note: This creates a "hollow" Emulator with nil PIDs for GenServers. It's suitable for parsing and buffer operations but not for full terminal emulation with concurrent state management.

is_lite?(emulator)

This function is deprecated. Use lite?/1 instead.

lite?(arg1)

Checks if an emulator is the lite version (no GenServers).

to_lite(emulator)

Converts a full Emulator to EmulatorLite, discarding GenServer references.

This is useful for extracting just the state without the process overhead.