Expand description
ez-tui is a library for building terminal user interfaces (TUIs) in Rust written by a beginner for his own needs.
You probably should not use this
Structs§
- AppArguments
- Wraps the library and your business logic command line arguments.
- AppState
Cpt - A component to display the application state at runtime
- Application
- Application is the struct that will hold all the parts of your TUI application.
- Border
Theme - Wraps all the defining attributes of a border
- Checkbox
Input Cpt - A component drawing a
FormFieldof typeFormFieldType::CheckBox. - Common
Arg - Holds the command line arguments to change this lib behavior.
- Custom
Layout - A layout wrapper that makes it easy to create nested layouts.
- Date
Time Input Cpt - A component drawing a
FormFieldof typeFormFieldType::DateTime,FormFieldType::Date, orFormFieldType::Time. - Debug
Widget Mock - A mock component display some value at runtime
- Field
Result - A type wrapping a form field and its value.
- Form
- Describes a whole form, which can contain multiple fields and sub-forms. As a form has a fixed layout direction, sub forms can be used to change the direction.
- FormCpt
- A component responsible for rendering a form.
- Form
Field - Describe one field inside a form.
- Form
Result - A type wrapping all the
FieldResults of a form into aVec. - Global
HotKeys - A struct representing global hotkeys for the application.
- HotKey
- A struct representing a hotkey combination.
- Indicator
Mock - A mock component to display a colored indicator inside the TUI. The indicator is a simple box alternating its style from a given set of
StylewhenSelf::cycleis called. - Input
Builder - A builder for creating input components based on a given form field. TODO: bad design
- Legend
- A struct representing a legend for hotkeys
- Legend
Mock - A mock component to display a colored indicator inside the TUI. The indicator is a simple box alternating its style from a given set of
Stylewhen [Self::cycle] is called. - Legends
- A component to display a colored indicator alternating colors based on the frame rate of the terminal.
- LogSwitcher
- A struct to allow togling on or off the stdout logging so we have it during args parsing and app exit but not during TUI execution.
- Logs
Mock - A generic mock component to display logs inside the TUI
- Logs
Viewer - An implementation of
Componentfor theLogsMockcomponent. This component initializestui_loggerand so it should be instantiated only once. - Matcher
- A struct associating some
HotKeys with an action - Mouse
Event Clause - Struct to be more specific on the mouse event clause. Allow checking the range of the event and any modifiers.
- NoClient
Args - Dummy struct to use when you don’t need any client arguments.
- NoClient
CptId - A dummy type to be used when you don’t have any component ids
- NoClient
Error - Dummy type to use if your application does not handle any specific errors.
- NoClient
Msg - A dummy type to be used when you don’t have any messages
- NoClient
Ship Id - A dummy type to be used when you don’t have any ship ids
- NoClient
State - A dummy type to be used when you don’t have any state
- Number
Input Cpt - A component drawing a
FormFieldof typeFormFieldType::Number. - Port
- The port is the struct that holds all your ships. Like the [
View], you’ll only have one port in your app but as many ships as you want. Again like the [View], the port is the orchestrator of your ships. It will send the forward to/from the ships and your app. - Props
- Range
Input Cpt - A component drawing a
FormFieldof typeFormFieldType::Range. - Receiver
- A wrapper around
mpsc::UnboundedReceiverto work explicitly with this cratesErrorandResult - Render
Indicator Cpt - A component to display a colored indicator alternating colors based on the frame rate of the terminal.
- Select
Input Cpt - A component drawing a
FormFieldof typeFormFieldType::Select. - Sender
- A wrapper around
mpsc::UnboundedSenderto work explicitly with this cratesErrorandResult - State
- The state of the application. It includes some generic state needed by the library as well as your sustom state if you have some;
- Subscription
- A subscription describe if a target should be forwarded an event and under which conditions.
The target is described by a
SubIdso it can be either a [Component] or a [Ship]. The event is forwarded only if - Text
Input Cpt - A component drawing a
FormFieldof typeFormFieldType::TextorFormFieldType::Password. - Theme
- Holds some commonly used style across your application
- Tick
Indicator Cpt - A component to display a colored indicator alternating colors based on the tick rate of the terminal.
- View
- The view is the struct that holds all your components. You’ll only have one view in your app but as many components as you want. Those components will be orchestrated by the view. This includes handling their layout, the focused one and forward event to them if needed.
Enums§
- Attr
Value - Attribute
- Date
Time Config - The type of date and time configuration for a form field.
- Error
- Error type for the library
- Event
Clause EventClausecan be seen as categories of events. When you want a target to listen for events, you don’t subscribe to this event explicitly but to its category.- EzCptId
- Wrapper around the client’s component ids enum
- EzEvent
- All the events that can be sent across the application.
Your custom events will be wrapped inside
EzEvent::Client. - EzShip
Id - Wrapper around the client’s ship ids enum. Useless for now.
- Form
Field Type - All the possible form field type with their configs if needed.
- Form
Field Value - All possible values types for a form field.
- Form
Node - A form node is either a field or whole sub-form.
- IoContext
- Some context associated with any IO error that may occur.
- Layout
Item - An item of a layout. It can be either a nested
CustomLayoutor a component id. - Port
Error - The errors that could happen when using the
Port - SubClause
SubClausedefines unde what conditions the event should be forwarded to the target based on its state.- SubId
- Every subscription target is either for a [
Component] or a [Ship]. We wrap the id of that target inside this enum to know if it refers to a component or a ship. - View
Error - The errors that could happen when using the
View
Traits§
- Component
- A type to describe a concrete component. In your app, every component should have it’s own struct implementing this trait.
- EzArgs
- Trait to be defined on your client’s clap arguments enum.
- EzCpt
Ids - Trait to be defined on your client’s component idq enum.
- EzMsg
- Trait to be defined on your client’s messages enum
- EzShip
Ids - Trait to be defined on your client’s ship ids enum.
- EzState
- Trait to be defined on your client’s state
- Focus
Chain - A trait to define to describe a chain of focusable items.
- Input
Cpt - A trait to be implemented by all input components in the form system.
- Mock
Component - A type to describe a “reusable” component.
- Mock
Props - Similar to
MockComponent, but for the component’s attributes. - Ship
- A ship is a struct that can be subscribed to some events; execute some - probably async - code; and emit events. It is used if your app is dependent on some api calls, or other IO operations, they’ll certainly have to be done done via a Ship.
Type Aliases§
- Boxed
Component - A type alias for a
Componentinside aBox. - Boxed
Ship - A type alias for a
Shipinside aBox. - Result
- A
std::result::Resultwrapper using this crate’sErroras the error type.