pub struct RawInput<'a>(/* private fields */);Expand description
The original, pre-decode bytes of a key press, borrowed from the caller’s read buffer, to be forwarded verbatim when no layer binds the input.
RawInput is a view, not a copy: it borrows the exact bytes[..consumed]
span the decoder reported (see keymap_term::Decoded), so forwarding it to the
sink is a byte-identity copy with no re-encoding. It is constructed only from
real bytes via RawInput::from_bytes; there is deliberately no
From<KeyInput>. Decode is lossy (SHIFT folding, BackTab ≡ shift+tab,
ctrl+i ≡ tab, and some keys produce no KeyInput at all), so re-encoding a
decoded key would corrupt or inject bytes. The borrow representation makes that
footgun structurally impossible — there is no owned buffer for a From impl
to return a reference into:
use keymap_core::{Key, KeyInput, Modifiers, RawInput};
let decoded = KeyInput::new(Key::Char('a'), Modifiers::NONE);
// There is no way back from a decoded key to its raw bytes — decode is lossy.
let _raw: RawInput = RawInput::from(decoded); // ERROR: `From<KeyInput>` does not exist