Expand description
Memoization utilities for the textarea component.
This module contains a simple, hash-keyed cache for memoizing soft-wrapped
lines. The MemoizedWrap struct provides the wrapping entrypoint used by
textarea::Model to compute visual sub-lines for a given logical line and
width. Results are cached to avoid repeated recomputation while navigating.
The generic MemoCache is a small LRU cache, provided for parity with the
upstream design. The current MemoizedWrap uses an internal HashMap and
fixed capacity to keep the implementation straightforward.
Structs§
- Line
- Line input for text wrapping, implementing Hasher trait
- Memo
Cache - Generic memoization cache with LRU eviction policy. This is a direct port of Go’s MemoCache with generics.
- Memoized
Wrap - Memoized text wrapping functionality
Traits§
- Hasher
- A trait for objects that can provide a hash for memoization. This matches the Go Hasher interface.