pub struct InputMapper;Expand description
Pure input mapper.
Stateless beyond the borrowed InputState; one instance lives for the
runtime’s lifetime. Methods never touch the terminal, the session, or any
I/O.
Implementations§
Source§impl InputMapper
impl InputMapper
Sourcepub fn map(
&self,
event: &UiEvent,
view: &ViewState,
editor_text: &str,
state: &mut InputState,
editor_consumed: bool,
) -> Vec<ViewAction>
pub fn map( &self, event: &UiEvent, view: &ViewState, editor_text: &str, state: &mut InputState, editor_consumed: bool, ) -> Vec<ViewAction>
Translate one UiEvent into zero or more ordered [ViewAction]s.
editor_consumed is true when the focused editor/component already
returned Consumed or Render for this event; in that case the mapper
only emits actions for non-key events (Resize, Paste) that the
component cannot logically claim.
editor_text is the live editor buffer at the moment the event was
received — the snapshot in view.editor.text may lag by one paint.
Callers should pass the editor’s current get_text() so submit /
bash-detection see the same string the user typed.
Trait Implementations§
Source§impl Debug for InputMapper
impl Debug for InputMapper
Source§impl Default for InputMapper
impl Default for InputMapper
Source§fn default() -> InputMapper
fn default() -> InputMapper
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InputMapper
impl RefUnwindSafe for InputMapper
impl Send for InputMapper
impl Sync for InputMapper
impl Unpin for InputMapper
impl UnsafeUnpin for InputMapper
impl UnwindSafe for InputMapper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.