MCPcopy Create free account
hub / github.com/emberian/evdev / fmt

Method fmt

src/lib.rs:447–471  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter)

Source from the content-addressed store, hash-verified

445
446impl fmt::Debug for InputEvent {
447 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
448 let summary = self.destructure();
449 let code: &dyn fmt::Debug = match &summary {
450 EventSummary::Synchronization(_, code, _) => code,
451 EventSummary::Key(_, code, _) => code,
452 EventSummary::RelativeAxis(_, code, _) => code,
453 EventSummary::AbsoluteAxis(_, code, _) => code,
454 EventSummary::Misc(_, code, _) => code,
455 EventSummary::Switch(_, code, _) => code,
456 EventSummary::Led(_, code, _) => code,
457 EventSummary::Sound(_, code, _) => code,
458 EventSummary::Repeat(_, code, _) => code,
459 EventSummary::ForceFeedback(_, code, _) => code,
460 EventSummary::Power(_, code, _) => code,
461 EventSummary::ForceFeedbackStatus(_, code, _) => code,
462 EventSummary::UInput(_, code, _) => code,
463 EventSummary::Other(_, code, _) => &code.1,
464 };
465 f.debug_struct("InputEvent")
466 .field("time", &self.timestamp())
467 .field("type", &self.event_type())
468 .field("code", code)
469 .field("value", &self.value())
470 .finish()
471 }
472}
473
474/// Crawls `/dev/input` for evdev devices.

Callers

nothing calls this directly

Calls 4

event_typeMethod · 0.80
valueMethod · 0.80
destructureMethod · 0.45
timestampMethod · 0.45

Tested by

no test coverage detected