Struct EventContext

pub struct EventContext<'r> { /* private fields */ }

Give access to user input.

Implementations

impl<'r> EventContext<'r>

fn mode(&self) -> EditMode

emacs or vi mode

fn input_mode(&self) -> InputMode

vi input mode

fn has_hint(&self) -> bool

Returns true if there is a hint displayed.

fn hint_text(&self) -> Option<&str>

Returns the hint text that is shown after the current cursor position.

fn line(&self) -> &str

currently edited line

fn pos(&self) -> usize

Current cursor position (byte position)

Auto Trait Implementations

impl<'r> !RefUnwindSafe for EventContext<'r>

impl<'r> !Send for EventContext<'r>

impl<'r> !Sync for EventContext<'r>

impl<'r> !UnwindSafe for EventContext<'r>

impl<'r> Freeze for EventContext<'r>

impl<'r> Unpin for EventContext<'r>

impl<'r> UnsafeUnpin for EventContext<'r>

Blanket Implementations

impl<T> Any for EventContext<'r> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for EventContext<'r> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for EventContext<'r> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for EventContext<'r>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for EventContext<'r> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for EventContext<'r> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for EventContext<'r> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>