pub struct Curses { /* private fields */ }
Expand description

The curses instance. To initialize the curses instance, call initscr.

Implementations

Get a reference to the main Window of the cursees instance.

Get a mutable reference to the main Window of the cursees instance.

Get the output rate of the terminal in bits per second.

Attempt to beep the terminal

Check if the terminal has support for colors.

Start the color subsystem

Get an immutable reference to the color subsystem.

Get a mutable reference to the color subsystem.

Enable cbreak mode, causing input to immediately be ready for read after it is typed.

This overrides raw.

Disable cbreak mode, causing input to be buffered after it is typed until a newline or carriage return.

This overrides raw.

Set the visibility of the cursor.

Save the current terminal state as program mode (in curses).

This is done automatically by initscr.

Save the current terminal state as shell mode (not in curses).

This is done automatically by initscr.

Insert a millisecond pause in output. Don’t use this extensively.

Push updates from the virtual screen to the physical screen.

This is the corollary of doupdate.

Characters typed by the user are written to the screen as they are typed.

Characters typed by the user are interpretted by the program and not echoed to the screen.

Dispose of this window.

This allows for the user to deal with error conditions instead of Result::unwrap being called.

This is the corollary of endwin.

Flash the terminal screen. If not possible, an alert is sounded.

Returns Ok if flashing succeeds, and Err otherwise.

Get a string representing a key code.

This is the corollary of keyname.

Get the status of the mouse.

This is the corollary of getmouse.

Get the maximum time between press and release events for it to be recognized as a click.

This is the corollary of mouseinterval(-1).

Set the maximum time between press and release events for it to be recognized as a click.

As of right now this will always succeed, but it is possible this behavior will change in the future.

This is the corollary of mouseinterval.

Set the mouse events to be reported.

Returns the masks that were applied.

As of right now this will always succeed, but it is possible this behavior will change in the future.

If mask == 0 then the mouse pointer may be turned off.

This is the corollary of mousemask.

Sleep for a certain number of milliseconds.

This is the corollary of napms.

Enable new line translations.

When enabled, the return key is translated into newline on input and return and line-feed on output.

This is enabled by default. Disabling this can cause curses to make better use of the line-feed capability, will have faster cursor motion, and will detect the return key (see Input::KeyEnter).

This is the corollary of nl.

Disable new line translations.

See enable_new_line_translations.

This is the corollary of nonl.

Enable raw input mode. Characters are immediately passed through to the user program and no signals are generated.

This is similar to cbreak mode (see enable_cbreak).

This is the corollary of raw.

Disable raw input mode.

For discussion of how raw mode works, see enable_raw_input_mode.

This is the corollary of noraw.

Restore the terminal to program mode (in curses).

This is the corollary of reset_prog_mode.

Restore the terminal to program mode (not in curses).

This is the corollary of reset_shell_mode.

Attempt to resize the terminal.

This is the corollary of resize_term.

Force the screen to actually blink instead of setting a high intensity background.

This is only supported on Windows.

This is the corollary of set_blink(true)

Allow the terminal to either actually blink or set a high intensity background when blink is called.

This is the corollary of set_blink(false)

Set the title of the terminal.

This is only supported on Windows.

Trait Implementations

Call end_window and unwrap the result.

Executes the destructor for this 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.