Crate moto

Crate moto 

Source

Re-exports§

pub use menu::*;
pub use ast::*;
pub use parser::*;
pub use ctx::*;
pub use runtime::*;
pub use repository::*;

Modules§

ast
console
ctx
menu
parser
repository
runtime
value

Macros§

choice
choice! macro
divider
Macro to print a divider with optional text and styles
hex
hex! macro to convert hex color to ansi color example: hex!(#FF0000) -> “\x1b[38;2;255;0;0m”
hexbg
hexbg! macro to convert hex color to ansi background color example: hexbg!(#FF0000) -> “\x1b[48;2;255;0;0m\x1b[30m” example: hexbg!(#FF0000, 255) -> “\x1b[48;2;255;0;0m\x1b[30m” example: hexbg!(#FF0000, 255, 255, 255) -> “\x1b[48;2;255;0;0m\x1b[30m”
paragraph
Macro to print a paragraph with a title and text The text is automatically wrapped to the max width
render
Same as show! but returns a string instead of printing it
selection
selection! macro
show
showln
tree
Macro to print a tree of the provided serializable object

Structs§

CStyle
Struct to represent a console style
Choice
Choice
File
An object providing access to an open file on the filesystem.
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
Map
Options
Holds configuration options for wrapping and filling text.

Enums§

LineEnding
Supported line endings. Like in the Rust standard library, two line endings are supported: \r\n and \n
Val
ValueConversionError
WordSeparator
Describes where words occur in a line of text.
WordSplitter
The WordSplitter enum describes where words can be split.
WrapAlgorithm
Describes how to wrap words into lines.

Constants§

RESET_COLOR
blink
blue
blue_bold
blue_dim
bluebg
bold
cyan
cyan_bold
cyan_dim
cyanbg
dim
gray
gray_bold
gray_dim
graybg
green
green_bold
green_dim
greenbg
italic
magenta
magenta_bold
magenta_dim
magentabg
nostyle
orange
orange_bold
orange_dim
orangebg
pink
pink_bold
pink_dim
pinkbg
purple
purple_bold
purple_dim
purplebg
red
red_bold
red_dim
redbg
reset_color
underline
white
white_bold
white_dim
whitebg
yellow
yellow_bold
yellow_dim
yellowbg

Traits§

Deserialize
A data structure that can be deserialized from any data format supported by Serde.
Pickable
Pickable trait to be implemented for pickable items
Serialize
A data structure that can be serialized into any data format supported by Serde.
Stylable
Trait to provide styling and printing functionalities

Functions§

clear_line
Clear the current line
clear_screen
Clear the entire screen
code_to_char
dedent
Removes common leading whitespace from each line.
disable_raw_mode
Disable raw mode on stdin (no external dependencies)
divider
Print a divider as per max width
divider_vibrant
Print a divider with vibrant colors
enable_raw_mode
Enable raw mode on stdin (no external dependencies)
fill
Fill a line of text at a given width.
fill_inplace
Fill text in-place without reallocating the input string.
get_max_width
Get the maximum width for wrapping text
indent
Indent each line by the given prefix.
menu
move_down
Move the cursor down by n lines
move_left
Move the cursor left by n columns
move_right
Move the cursor right by n columns
move_up
Move the cursor up by n lines
print_framed
Print the provided text in a frame of x, y, w, h Automatically wraps the text to fit the width of the frame
print_positioned
Print the provided text at the provided position, offset by the provided x and y values from the current position x and y can be negative to move the cursor to the left or up e.g. print_positioned(0,0,"hello world") prints “hello world” at the current position
refill
Refill a paragraph of wrapped text with a new width.
reset_line
Reset the cursor to the beginning of the line
set_max_width
Set the maximum width for wrapping text
text
ask question
unfill
Unpack a paragraph of already-wrapped text.
wrap
Wrap a line of text at a given width.
wrap_columns
Wrap text into columns with a given total width.
wrap_text
Wrap text to fit the specified width

Type Aliases§

Closure
Predicate

Derive Macros§

Deserialize
Serialize