Struct yacll::Yogurt

source ·
pub struct Yogurt { /* private fields */ }
Expand description

Yet Another Data Storage U Struct. Main struct for methods.

Unless a method specifies it flushes the buffer, calling the flush method will be required for the changes to take effect.

Implementations

Output to the terminal.

Print a string to the cursor location.

Move the cursor to the specified point.

Move the cursor to the specified point and print.

Flush the buffer.

Draw a box with the provided characters.

You can use the constants BORDER or ROUND_BORDER instead of defining your own.

Example of defining custom border:

let my_super_cool_border =
['┌', '─', '┐',
 '│',      '│',
 '└', '─', '┘'];

An example can be found by running $ cargo run --example=border.

Enter “alternate mode.” See also leave_alt.

In alternate mode, the following things are true:

  • input will be avaliable imideately to the program (not line buffered)
  • special keys will not be processed (^C won’t do anything!)
  • newline will not be proccessed
  • an “alternate screen” will be entered, which has no scroll area and any changes made to the screen will not be preserved when switching back to the main screen.

In effect, alternate mode just enters an alternate screen and enables terminal raw mode.

This function also flushes the buffer.

Leave “alternate mode.” See also enter_alt.

This function also flushes the buffer.

Clear the screen.

Styling of text and cursor.

Turn on a cursor attribute.

Turn off a cursor attribute. Turning off a cursor shape resets it to Block.

Enable a style.

Functions for getting input from the user.

Read an event. Will error if not in alt-mode. Duration is how long to wait for an event before returning.

Like read_event, except instead of exiting with None after dur has passed, it blocks the thread.

Create a new yogurt.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.