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

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

Many curses functions have been renamed for one reason or another. All renamed functions state the curses function they corollate to.

Implementations

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

This corresponds to stdscr.

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

This corresponds to stdscr.

Check if the terminal has support for colors.

Start the color subsystem.

If it has already been started, this does nothing.

Get an immutable reference to the Color subsystem.

This method will panic if start_color has not successfully completed yet.

Get a mutable reference to the Color subsystem.

This method will panic if start_color has not successfully completed yet.

Set the visibility of the cursor.

This corresponds of curs_set.

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

This is done automatically by initscr.

This corresponds of def_prog_mode.

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

This is done automatically by initscr.

This corresponds of def_shell_mode.

Restore the terminal to program mode (in curses).

This corresponds of reset_prog_mode.

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

This corresponds of reset_shell_mode.

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

This corresponds to baudrate.

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

Push updates from the virtual screen to the physical screen.

This corresponds of doupdate.

Control whether characters typed by the user are written to the screen as they are typed.

If enabled, characters typed by the user are written to the screen as they are typed.

If disabled, characters typed by the user are interpretted by the program and not echoed to the screen.

This corresponds of echo and noecho.

Set the input buffering mode.

See InputBufferingMode for more informatation.

This corresponds of cbreak, nocbreak, raw, and noraw.

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 corresponds of nl and nonl.

Throw away all unread key events.

This corresponds of flushinp.

[read_char] will block for at most duration and wait for input.

This will fail if duration is not inbetween 0.1 and 2.55 seconds. duration is rounded down to the nearest tenth of a second. For more fidelity, see Window::set_timeout.

From reading the ncurses source code, I have deduced that this overrides the specific Window’s timeout.

Use disable_cbreak to stop this.

This corresponds of halfdelay.

End the instance of curses, allowing for error handling outside of panicking.

This returns the terminal to shell mode.

This disposes of the main Window.

This corresponds 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 corresponds of keyname.

Get the status of the mouse.

This corresponds of getmouse.

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

This corresponds 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 corresponds 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 corresponds of mousemask.

Sleep for a certain number of milliseconds.

This corresponds of napms.

Attempt to resize the terminal.

This corresponds of resize_term.

Attempt to beep the terminal.

Control whether characters with A_BLINK will actually blink the screen or if it will set a high intensity background.

When enabled, the screen will actually blink instead of setting a high intensity background.

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

This is only supported on Windows.

This corresponds of set_blink.

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.