Skip to main content

EventLogger

Struct EventLogger 

Source
pub struct EventLogger { /* private fields */ }
Expand description

Event logger for debugging

Implementations§

Source§

impl EventLogger

Source

pub fn new() -> Self

Create new event logger

Source

pub fn max_events(self, max: usize) -> Self

Set maximum events to keep

Source

pub fn filter(self, filter: EventFilter) -> Self

Set filter

Source

pub fn clear(&mut self)

Clear all events

Source

pub fn pause(&mut self)

Pause logging

Source

pub fn resume(&mut self)

Resume logging

Source

pub fn toggle_pause(&mut self)

Toggle pause

Source

pub fn is_paused(&self) -> bool

Is paused

Source

pub fn log(&mut self, event_type: EventType, details: impl Into<String>) -> u64

Log an event

Source

pub fn log_key(&mut self, key: &str, modifiers: &str) -> u64

Log a key event

Source

pub fn log_click(&mut self, x: u16, y: u16, button: &str) -> u64

Log a mouse click

Source

pub fn log_move(&mut self, x: u16, y: u16) -> u64

Log a mouse move

Source

pub fn log_focus(&mut self, target: &str, gained: bool) -> u64

Log focus change

Source

pub fn mark_handled(&mut self, id: u64)

Mark event as handled

Source

pub fn set_target(&mut self, id: u64, target: impl Into<String>)

Set event target

Source

pub fn count(&self) -> usize

Get event count

Source

pub fn filtered_count(&self) -> usize

Get filtered event count

Source

pub fn select_next(&mut self)

Select next event

Source

pub fn select_prev(&mut self)

Select previous event

Source

pub fn toggle_keys(&mut self)

Toggle key events filter

Source

pub fn toggle_mouse(&mut self)

Toggle mouse events filter

Source

pub fn toggle_focus(&mut self)

Toggle focus events filter

Source

pub fn render_content( &self, buffer: &mut Buffer, area: Rect, config: &DevToolsConfig, )

Render event logger content

Trait Implementations§

Source§

impl Debug for EventLogger

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EventLogger

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.