Phosphor::Cmd
Base for one-shot async work returned from Screen#handle.
App#run spawns a fiber for each Cmd it receives and sends the
returned Event back on the main channel, re-entering the loop.
Concrete async subclasses (e.g. Cmd::Fetch) implement run to
perform their work and produce a result event.
Widget-navigation commands (Cmd::MoveUp, Cmd::MoveDown, Cmd::Tick)
also inherit from Cmd so that MockWidget#handle_cmd has a single
typed parameter. They raise NotImplementedError from run — they are
dispatched through handle_cmd, never through the async path.
See DESIGN.md § "Commands (Cmd)" for the full rationale and examples.
Instance methods
Performs async work and returns an Event that re-enters the main loop.
Called by App#run in a spawned fiber. The event is sent on the shared
Channel(Event) and dispatched like any keyboard or port event on the
next iteration.
Nested types
- Phosphor::Cmd::Cancel
- Phosphor::Cmd::Collapse
- Phosphor::Cmd::Confirm
- Phosphor::Cmd::Copy
- Phosphor::Cmd::DeleteChar
- Phosphor::Cmd::Expand
- Phosphor::Cmd::Fetch
- Phosphor::Cmd::InlineDismiss
- Phosphor::Cmd::InlineResize
- Phosphor::Cmd::InsertChar
- Phosphor::Cmd::InsertString
- Phosphor::Cmd::MouseDrag
- Phosphor::Cmd::MousePress
- Phosphor::Cmd::MouseRelease
- Phosphor::Cmd::MoveCursorLeft
- Phosphor::Cmd::MoveCursorRight
- Phosphor::Cmd::MoveCursorTo
- Phosphor::Cmd::MoveDown
- Phosphor::Cmd::MoveLeft
- Phosphor::Cmd::MoveRight
- Phosphor::Cmd::MoveUp
- Phosphor::Cmd::Paste
- Phosphor::Cmd::Pop(S, M)
- Phosphor::Cmd::Print
- Phosphor::Cmd::Push(S, M)
- Phosphor::Cmd::Replace(S, M)
- Phosphor::Cmd::ScrollDown
- Phosphor::Cmd::ScrollLeft
- Phosphor::Cmd::ScrollRight
- Phosphor::Cmd::ScrollToBottom
- Phosphor::Cmd::ScrollToTop
- Phosphor::Cmd::ScrollUp
- Phosphor::Cmd::SelectAll
- Phosphor::Cmd::ShiftTab
- Phosphor::Cmd::Submit
- Phosphor::Cmd::Tab
- Phosphor::Cmd::TabNext
- Phosphor::Cmd::TabPrev
- Phosphor::Cmd::Tick