225 lines
No EOL
33 KiB
HTML
225 lines
No EOL
33 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `Terminal` trait in crate `linefeed`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, Terminal">
|
||
|
||
<title>linefeed::terminal::Terminal - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../normalize.css">
|
||
<link rel="stylesheet" type="text/css" href="../../rustdoc.css"
|
||
id="mainThemeStyle">
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../dark.css">
|
||
<link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle">
|
||
<script src="../../storage.js"></script>
|
||
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc trait">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
<div class="sidebar-menu">☰</div>
|
||
|
||
<p class='location'>Trait Terminal</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.PrepareGuard">PrepareGuard</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.new">new</a><a href="#tymethod.eof_char">eof_char</a><a href="#tymethod.literal_char">literal_char</a><a href="#tymethod.erase_char">erase_char</a><a href="#tymethod.word_erase_char">word_erase_char</a><a href="#tymethod.kill_char">kill_char</a><a href="#tymethod.delete_seq">delete_seq</a><a href="#tymethod.insert_seq">insert_seq</a><a href="#tymethod.name">name</a><a href="#tymethod.size">size</a><a href="#tymethod.clear_screen">clear_screen</a><a href="#tymethod.clear_to_screen_end">clear_to_screen_end</a><a href="#tymethod.move_up">move_up</a><a href="#tymethod.move_down">move_down</a><a href="#tymethod.move_left">move_left</a><a href="#tymethod.move_right">move_right</a><a href="#tymethod.move_to_first_col">move_to_first_col</a><a href="#tymethod.set_cursor_mode">set_cursor_mode</a><a href="#tymethod.wait_for_input">wait_for_input</a><a href="#tymethod.prepare">prepare</a><a href="#tymethod.get_signal">get_signal</a><a href="#tymethod.take_signal">take_signal</a><a href="#tymethod.read_signals">read_signals</a><a href="#tymethod.read">read</a><a href="#tymethod.write">write</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>linefeed</a>::<wbr><a href='index.html'>terminal</a></p><script>window.sidebarCurrent = {name: 'Terminal', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
|
||
</nav>
|
||
|
||
<div class="theme-picker">
|
||
<button id="theme-picker" aria-label="Pick another theme!">
|
||
<img src="../../brush.svg" width="18" alt="Pick another theme!">
|
||
</button>
|
||
<div id="theme-choices"></div>
|
||
</div>
|
||
<script src="../../theme.js"></script>
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content"><h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>linefeed</a>::<wbr><a href='index.html'>terminal</a>::<wbr><a class="trait" href=''>Terminal</a></span><span class='out-of-band'><span id='render-detail'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a class='srclink' href='../../src/linefeed/terminal.rs.html#93-201' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust trait'>pub trait Terminal: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||
type <a href='#associatedtype.PrepareGuard' class="type">PrepareGuard</a>;
|
||
fn <a href='#tymethod.new' class='fnname'>new</a>() -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.eof_char' class='fnname'>eof_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.literal_char' class='fnname'>literal_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.erase_char' class='fnname'>erase_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.word_erase_char' class='fnname'>word_erase_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.kill_char' class='fnname'>kill_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.delete_seq' class='fnname'>delete_seq</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.insert_seq' class='fnname'>insert_seq</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.name' class='fnname'>name</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.size' class='fnname'>size</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../../linefeed/terminal/struct.Size.html" title="struct linefeed::terminal::Size">Size</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.clear_screen' class='fnname'>clear_screen</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.clear_to_screen_end' class='fnname'>clear_to_screen_end</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.move_up' class='fnname'>move_up</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.move_down' class='fnname'>move_down</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.move_left' class='fnname'>move_left</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.move_right' class='fnname'>move_right</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.move_to_first_col' class='fnname'>move_to_first_col</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.set_cursor_mode' class='fnname'>set_cursor_mode</a>(&self, mode: <a class="enum" href="../../linefeed/terminal/enum.CursorMode.html" title="enum linefeed::terminal::CursorMode">CursorMode</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.wait_for_input' class='fnname'>wait_for_input</a>(&self, timeout: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.prepare' class='fnname'>prepare</a>(<br> &self, <br> catch_signals: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> report_signals: <a class="struct" href="../../linefeed/terminal/struct.SignalSet.html" title="struct linefeed::terminal::SignalSet">SignalSet</a><br> ) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self::<a class="type" href="../../linefeed/terminal/trait.Terminal.html#associatedtype.PrepareGuard" title="type linefeed::terminal::Terminal::PrepareGuard">PrepareGuard</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.get_signal' class='fnname'>get_signal</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../linefeed/terminal/enum.Signal.html" title="enum linefeed::terminal::Signal">Signal</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.take_signal' class='fnname'>take_signal</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../linefeed/terminal/enum.Signal.html" title="enum linefeed::terminal::Signal">Signal</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.read_signals' class='fnname'>read_signals</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self::<a class="type" href="../../linefeed/terminal/trait.Terminal.html#associatedtype.PrepareGuard" title="type linefeed::terminal::Terminal::PrepareGuard">PrepareGuard</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.read' class='fnname'>read</a>(&self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.write' class='fnname'>write</a>(&self, s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>;
|
||
}</pre></div><div class='docblock'><p>Defines a low-level interface to the terminal</p>
|
||
</div>
|
||
<h2 id='associated-types' class='small-section-header'>
|
||
Associated Types<a href='#associated-types' class='anchor'></a>
|
||
</h2>
|
||
<div class='methods'>
|
||
<h3 id='associatedtype.PrepareGuard' class='method'><span id='PrepareGuard.t' class='invisible'><code>type <a href='#associatedtype.PrepareGuard' class="type">PrepareGuard</a></code></span></h3><div class='docblock'><p>Returned by <code>prepare</code> and <code>read_signals</code>.
|
||
When dropped, the prior terminal state will be restored.</p>
|
||
</div></div>
|
||
<h2 id='required-methods' class='small-section-header'>
|
||
Required Methods<a href='#required-methods' class='anchor'></a>
|
||
</h2>
|
||
<div class='methods'>
|
||
<h3 id='tymethod.new' class='method'><span id='new.v' class='invisible'><code>fn <a href='#tymethod.new' class='fnname'>new</a>() -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self></code></span></h3><div class='docblock'><p>Initialize the terminal interface</p>
|
||
</div><h3 id='tymethod.eof_char' class='method'><span id='eof_char.v' class='invisible'><code>fn <a href='#tymethod.eof_char' class='fnname'>eof_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a></code></span></h3><div class='docblock'><p>Returns the character that indicates end-of-file</p>
|
||
</div><h3 id='tymethod.literal_char' class='method'><span id='literal_char.v' class='invisible'><code>fn <a href='#tymethod.literal_char' class='fnname'>literal_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a></code></span></h3><div class='docblock'><p>Returns the character that indicates literal quoting sequence</p>
|
||
</div><h3 id='tymethod.erase_char' class='method'><span id='erase_char.v' class='invisible'><code>fn <a href='#tymethod.erase_char' class='fnname'>erase_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a></code></span></h3><div class='docblock'><p>Returns the character that indicates backward character erase</p>
|
||
</div><h3 id='tymethod.word_erase_char' class='method'><span id='word_erase_char.v' class='invisible'><code>fn <a href='#tymethod.word_erase_char' class='fnname'>word_erase_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a></code></span></h3><div class='docblock'><p>Returns the character that indicates backward word erase</p>
|
||
</div><h3 id='tymethod.kill_char' class='method'><span id='kill_char.v' class='invisible'><code>fn <a href='#tymethod.kill_char' class='fnname'>kill_char</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a></code></span></h3><div class='docblock'><p>Returns the character that indicates backward kill line</p>
|
||
</div><h3 id='tymethod.delete_seq' class='method'><span id='delete_seq.v' class='invisible'><code>fn <a href='#tymethod.delete_seq' class='fnname'>delete_seq</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code></span></h3><div class='docblock'><p>Returns the key sequence that indicates forward delete character</p>
|
||
</div><h3 id='tymethod.insert_seq' class='method'><span id='insert_seq.v' class='invisible'><code>fn <a href='#tymethod.insert_seq' class='fnname'>insert_seq</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code></span></h3><div class='docblock'><p>Returns the key sequence that indicates switching to insert mode</p>
|
||
</div><h3 id='tymethod.name' class='method'><span id='name.v' class='invisible'><code>fn <a href='#tymethod.name' class='fnname'>name</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></code></span></h3><div class='docblock'><p>Returns the name of the terminal, if one has been supplied</p>
|
||
</div><h3 id='tymethod.size' class='method'><span id='size.v' class='invisible'><code>fn <a href='#tymethod.size' class='fnname'>size</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../../linefeed/terminal/struct.Size.html" title="struct linefeed::terminal::Size">Size</a>></code></span></h3><div class='docblock'><p>Returns the size of the terminal window</p>
|
||
</div><h3 id='tymethod.clear_screen' class='method'><span id='clear_screen.v' class='invisible'><code>fn <a href='#tymethod.clear_screen' class='fnname'>clear_screen</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Presents a clear terminal screen, with cursor at first row, first column.</p>
|
||
<p>If the terminal possesses a scrolling window over a buffer, this shall
|
||
have the effect of moving the visible window down such that it shows
|
||
an empty view of the buffer, preserving some or all of existing buffer
|
||
contents, where possible.</p>
|
||
</div><h3 id='tymethod.clear_to_screen_end' class='method'><span id='clear_to_screen_end.v' class='invisible'><code>fn <a href='#tymethod.clear_to_screen_end' class='fnname'>clear_to_screen_end</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Clears characters on the line occupied by the cursor, beginning with the
|
||
cursor and ending at the end of the line. Also clears all characters on
|
||
all lines after the cursor.</p>
|
||
</div><h3 id='tymethod.move_up' class='method'><span id='move_up.v' class='invisible'><code>fn <a href='#tymethod.move_up' class='fnname'>move_up</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Moves the cursor up <code>n</code> cells; <code>n</code> may be zero.</p>
|
||
</div><h3 id='tymethod.move_down' class='method'><span id='move_down.v' class='invisible'><code>fn <a href='#tymethod.move_down' class='fnname'>move_down</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Moves the cursor down <code>n</code> cells; <code>n</code> may be zero.</p>
|
||
</div><h3 id='tymethod.move_left' class='method'><span id='move_left.v' class='invisible'><code>fn <a href='#tymethod.move_left' class='fnname'>move_left</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Moves the cursor left <code>n</code> cells; <code>n</code> may be zero.</p>
|
||
</div><h3 id='tymethod.move_right' class='method'><span id='move_right.v' class='invisible'><code>fn <a href='#tymethod.move_right' class='fnname'>move_right</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Moves the cursor right <code>n</code> cells; <code>n</code> may be zero.</p>
|
||
</div><h3 id='tymethod.move_to_first_col' class='method'><span id='move_to_first_col.v' class='invisible'><code>fn <a href='#tymethod.move_to_first_col' class='fnname'>move_to_first_col</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Moves the cursor to the first column of the current line</p>
|
||
</div><h3 id='tymethod.set_cursor_mode' class='method'><span id='set_cursor_mode.v' class='invisible'><code>fn <a href='#tymethod.set_cursor_mode' class='fnname'>set_cursor_mode</a>(&self, mode: <a class="enum" href="../../linefeed/terminal/enum.CursorMode.html" title="enum linefeed::terminal::CursorMode">CursorMode</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Set the current cursor mode</p>
|
||
</div><h3 id='tymethod.wait_for_input' class='method'><span id='wait_for_input.v' class='invisible'><code>fn <a href='#tymethod.wait_for_input' class='fnname'>wait_for_input</a>(&self, timeout: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code></span></h3><div class='docblock'><p>Waits <code>timeout</code> for user input. If <code>timeout</code> is <code>None</code>, waits indefinitely.</p>
|
||
<p>Returns <code>Ok(true)</code> if input becomes available within the given timeout
|
||
or if a signal is received.</p>
|
||
<p>Returns <code>Ok(false)</code> if the timeout expires before input becomes available.</p>
|
||
</div><h3 id='tymethod.prepare' class='method'><span id='prepare.v' class='invisible'><code>fn <a href='#tymethod.prepare' class='fnname'>prepare</a>(<br> &self, <br> catch_signals: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> report_signals: <a class="struct" href="../../linefeed/terminal/struct.SignalSet.html" title="struct linefeed::terminal::SignalSet">SignalSet</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self::<a class="type" href="../../linefeed/terminal/trait.Terminal.html#associatedtype.PrepareGuard" title="type linefeed::terminal::Terminal::PrepareGuard">PrepareGuard</a>></code></span></h3><div class='docblock'><p>Prepares the terminal for line reading and editing operations.</p>
|
||
<p>When the returned value is dropped, the terminal will be restored to its
|
||
state prior to calling <code>prepare</code>.</p>
|
||
<p>If <code>catch_signals</code> is <code>true</code>, signal handlers will be registered.
|
||
These are also restored when the guard value is dropped.</p>
|
||
<p>The set of signals caught should include those contained in
|
||
<code>report_signals</code>.</p>
|
||
</div><h3 id='tymethod.get_signal' class='method'><span id='get_signal.v' class='invisible'><code>fn <a href='#tymethod.get_signal' class='fnname'>get_signal</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../linefeed/terminal/enum.Signal.html" title="enum linefeed::terminal::Signal">Signal</a>></code></span></h3><div class='docblock'><p>If the process received a signal since the last call to <code>take_signal</code>,
|
||
return it. Otherwise, return <code>None</code>.</p>
|
||
</div><h3 id='tymethod.take_signal' class='method'><span id='take_signal.v' class='invisible'><code>fn <a href='#tymethod.take_signal' class='fnname'>take_signal</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../linefeed/terminal/enum.Signal.html" title="enum linefeed::terminal::Signal">Signal</a>></code></span></h3><div class='docblock'><p>If the process received a signal since the last call to <code>take_signal</code>,
|
||
consume and return it. Otherwise, return <code>None</code>.</p>
|
||
</div><h3 id='tymethod.read_signals' class='method'><span id='read_signals.v' class='invisible'><code>fn <a href='#tymethod.read_signals' class='fnname'>read_signals</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self::<a class="type" href="../../linefeed/terminal/trait.Terminal.html#associatedtype.PrepareGuard" title="type linefeed::terminal::Terminal::PrepareGuard">PrepareGuard</a>></code></span></h3><div class='docblock'><p>Configures the terminal to interpret signal-inducing characters
|
||
as input without raising a signal.</p>
|
||
<p>When the returned value is dropped, the terminal will be restored to its
|
||
state prior to calling <code>read_signals</code>.</p>
|
||
</div><h3 id='tymethod.read' class='method'><span id='read.v' class='invisible'><code>fn <a href='#tymethod.read' class='fnname'>read</a>(&self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></span></h3><div class='docblock'><p>Reads some input from the terminal and appends it to the given buffer.</p>
|
||
<p>Returns the number of bytes read. <code>Ok(0)</code> may be returned to indicate
|
||
that no bytes can be read at this time.</p>
|
||
</div><h3 id='tymethod.write' class='method'><span id='write.v' class='invisible'><code>fn <a href='#tymethod.write' class='fnname'>write</a>(&self, s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes output to the terminal and immediately flushes it to the device.</p>
|
||
<p>For each newline <code>'\n'</code> written to the terminal, the cursor should
|
||
be moved to the first column of the following line.</p>
|
||
<p>The terminal interface shall not automatically move the cursor to the next
|
||
line when <code>write</code> causes a character to be written to the final column.</p>
|
||
</div></div>
|
||
<h2 id='implementors' class='small-section-header'>
|
||
Implementors<a href='#implementors' class='anchor'></a>
|
||
</h2>
|
||
<ul class='item-list' id='implementors-list'>
|
||
<li><table class='table-display'><tbody><tr><td><code>impl Terminal for <a class="struct" href="../../linefeed/memory/struct.MemoryTerminal.html" title="struct linefeed::memory::MemoryTerminal">MemoryTerminal</a><span class="where fmt-newline"> type <a href='#associatedtype.PrepareGuard' class="type">PrepareGuard</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>;</span></code><td><div class='out-of-band'><a class='srclink' href='../../src/linefeed/memory.rs.html#342-436' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
||
</ul><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
|
||
src="../../implementors/linefeed/terminal/trait.Terminal.js">
|
||
</script></section>
|
||
<section id='search' class="content hidden"></section>
|
||
|
||
<section class="footer"></section>
|
||
|
||
<aside id="help" class="hidden">
|
||
<div>
|
||
<h1 class="hidden">Help</h1>
|
||
|
||
<div class="shortcuts">
|
||
<h2>Keyboard Shortcuts</h2>
|
||
|
||
<dl>
|
||
<dt><kbd>?</kbd></dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt><kbd>S</kbd></dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt><kbd>↑</kbd></dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt><kbd>↓</kbd></dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt><kbd>↹</kbd></dt>
|
||
<dd>Switch tab</dd>
|
||
<dt><kbd>⏎</kbd></dt>
|
||
<dd>Go to active search result</dd>
|
||
<dt><kbd>+</kbd></dt>
|
||
<dd>Expand all sections</dd>
|
||
<dt><kbd>-</kbd></dt>
|
||
<dd>Collapse all sections</dd>
|
||
</dl>
|
||
</div>
|
||
|
||
<div class="infos">
|
||
<h2>Search Tricks</h2>
|
||
|
||
<p>
|
||
Prefix searches with a type followed by a colon (e.g.
|
||
<code>fn:</code>) to restrict the search to a given type.
|
||
</p>
|
||
|
||
<p>
|
||
Accepted types are: <code>fn</code>, <code>mod</code>,
|
||
<code>struct</code>, <code>enum</code>,
|
||
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
||
and <code>const</code>.
|
||
</p>
|
||
|
||
<p>
|
||
Search functions by type signature (e.g.
|
||
<code>vec -> usize</code> or <code>* -> vec</code>)
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../../";
|
||
window.currentCrate = "linefeed";
|
||
</script>
|
||
<script src="../../main.js"></script>
|
||
<script defer src="../../search-index.js"></script>
|
||
</body>
|
||
</html> |