<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Lwt_read_line.Terminal.html"> <link rel="Up" href="Lwt_read_line.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class attributes" rel=Appendix href="index_attributes.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of classes" rel=Appendix href="index_classes.html"> <link title="Index of class types" rel=Appendix href="index_class_types.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Lwt_condition" rel="Chapter" href="Lwt_condition.html"> <link title="Lwt_list" rel="Chapter" href="Lwt_list.html"> <link title="Lwt" rel="Chapter" href="Lwt.html"> <link title="Lwt_mutex" rel="Chapter" href="Lwt_mutex.html"> <link title="Lwt_mvar" rel="Chapter" href="Lwt_mvar.html"> <link title="Lwt_pool" rel="Chapter" href="Lwt_pool.html"> <link title="Lwt_sequence" rel="Chapter" href="Lwt_sequence.html"> <link title="Lwt_stream" rel="Chapter" href="Lwt_stream.html"> <link title="Lwt_switch" rel="Chapter" href="Lwt_switch.html"> <link title="Lwt_util" rel="Chapter" href="Lwt_util.html"> <link title="Lwt_pqueue" rel="Chapter" href="Lwt_pqueue.html"> <link title="Lwt_lib" rel="Chapter" href="Lwt_lib.html"> <link title="Lwt_glib" rel="Chapter" href="Lwt_glib.html"> <link title="Lwt_preemptive" rel="Chapter" href="Lwt_preemptive.html"> <link title="Lwt_event" rel="Chapter" href="Lwt_event.html"> <link title="Lwt_signal" rel="Chapter" href="Lwt_signal.html"> <link title="Lwt_react" rel="Chapter" href="Lwt_react.html"> <link title="Lwt_ssl" rel="Chapter" href="Lwt_ssl.html"> <link title="Lwt_text" rel="Chapter" href="Lwt_text.html"> <link title="Lwt_term" rel="Chapter" href="Lwt_term.html"> <link title="Lwt_read_line" rel="Chapter" href="Lwt_read_line.html"> <link title="Lwt_top" rel="Chapter" href="Lwt_top.html"> <link title="Lwt_chan" rel="Chapter" href="Lwt_chan.html"> <link title="Lwt_daemon" rel="Chapter" href="Lwt_daemon.html"> <link title="Lwt_gc" rel="Chapter" href="Lwt_gc.html"> <link title="Lwt_io" rel="Chapter" href="Lwt_io.html"> <link title="Lwt_log" rel="Chapter" href="Lwt_log.html"> <link title="Lwt_main" rel="Chapter" href="Lwt_main.html"> <link title="Lwt_process" rel="Chapter" href="Lwt_process.html"> <link title="Lwt_throttle" rel="Chapter" href="Lwt_throttle.html"> <link title="Lwt_timeout" rel="Chapter" href="Lwt_timeout.html"> <link title="Lwt_unix" rel="Chapter" href="Lwt_unix.html"> <link title="Lwt_sys" rel="Chapter" href="Lwt_sys.html"> <link title="Lwt_engine" rel="Chapter" href="Lwt_engine.html"> <link title="Lwt_bytes" rel="Chapter" href="Lwt_bytes.html"> <link title="Pa_lwt" rel="Chapter" href="Pa_lwt.html"> <link title="Pa_lwt_log" rel="Chapter" href="Pa_lwt_log.html"><link title="Control" rel="Section" href="#6_Control"> <link title="Creation of read-line instances" rel="Section" href="#6_Creationofreadlineinstances"> <link title="Predefined instances" rel="Section" href="#6_Predefinedinstances"> <title>Lwt_read_line.Control</title> </head> <body> <div class="navbar"><a class="pre" href="Lwt_read_line.Terminal.html" title="Lwt_read_line.Terminal">Previous</a> <a class="up" href="Lwt_read_line.html" title="Lwt_read_line">Up</a> </div> <h1>Module <a href="type_Lwt_read_line.Control.html">Lwt_read_line.Control</a></h1> <pre><span class="keyword">module</span> Control: <code class="code"><span class="keyword">sig</span></code> <a href="Lwt_read_line.Control.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info"> Controlling a running read-line instance<br> </div> <hr width="100%"> <pre><span id="TYPEt"><span class="keyword">type</span> <code class="type">'a</code> t</span> </pre> <div class="info"> Type of a running read-line instance, returning a value of type <code class="code"><span class="keywordsign">'</span>a</code><br> </div> <br> <h6 id="6_Control">Control</h6><br> <pre><span id="VALresult"><span class="keyword">val</span> result</span> : <code class="type">'a <a href="Lwt_read_line.Control.html#TYPEt">t</a> -> 'a <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><div class="info"> Threads waiting for the read-line instance to terminates<br> </div> <pre><span id="VALsend_command"><span class="keyword">val</span> send_command</span> : <code class="type">'a <a href="Lwt_read_line.Control.html#TYPEt">t</a> -> <a href="Lwt_read_line.Command.html#TYPEt">Lwt_read_line.Command.t</a> -> unit</code></pre><div class="info"> <code class="code">send_command instance command</code> sends the given command to the read-line instance<br> </div> <pre><span id="VALaccept"><span class="keyword">val</span> accept</span> : <code class="type">'a <a href="Lwt_read_line.Control.html#TYPEt">t</a> -> unit</code></pre><div class="info"> <code class="code">accept instance = send_command instance <span class="constructor">Command</span>.<span class="constructor">Accept_line</span></code><br> </div> <pre><span id="VALinterrupt"><span class="keyword">val</span> interrupt</span> : <code class="type">'a <a href="Lwt_read_line.Control.html#TYPEt">t</a> -> unit</code></pre><div class="info"> <code class="code">accept instance = send_command instance <span class="constructor">Command</span>.<span class="constructor">Break</span></code><br> </div> <pre><span id="VALhide"><span class="keyword">val</span> hide</span> : <code class="type">'a <a href="Lwt_read_line.Control.html#TYPEt">t</a> -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><div class="info"> Hides everything (prompt, user input, completion box) until <a href="Lwt_read_line.Control.html#VALshow"><code class="code"><span class="constructor">Lwt_read_line</span>.<span class="constructor">Control</span>.show</code></a> is called.<br> </div> <pre><span id="VALshow"><span class="keyword">val</span> show</span> : <code class="type">'a <a href="Lwt_read_line.Control.html#TYPEt">t</a> -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><div class="info"> Un-hide everything<br> </div> <br> Note: in case the input is not a terminal, read-line instances are not controllable. i.e. <a href="Lwt_read_line.Control.html#VALaccept"><code class="code"><span class="constructor">Lwt_read_line</span>.<span class="constructor">Control</span>.accept</code></a>, <code class="code">refresh</code>, ... have no effect.<br> <br> <h6 id="6_Creationofreadlineinstances">Creation of read-line instances</h6><br> <pre><span id="TYPEprompt"><span class="keyword">type</span> <code class="type"></code>prompt</span> = <code class="type"><a href="Lwt_read_line.Engine.html#TYPEstate">Lwt_read_line.Engine.state</a> React.signal -> <a href="Lwt_term.html#TYPEstyled_text">Lwt_term.styled_text</a> React.signal</code> </pre> <div class="info"> The prompt a signal which may depends on the engine state<br> </div> <pre><span id="TYPEstate"><span class="keyword">type</span> <code class="type"></code>state</span> </pre> <div class="info"> State of an instance<br> </div> <pre><span id="VALengine_state"><span class="keyword">val</span> engine_state</span> : <code class="type"><a href="Lwt_read_line.Control.html#TYPEstate">state</a> -> <a href="Lwt_read_line.Engine.html#TYPEstate">Lwt_read_line.Engine.state</a></code></pre><div class="info"> Return the engine state of the given state<br> </div> <pre><span id="VALrender_state"><span class="keyword">val</span> render_state</span> : <code class="type"><a href="Lwt_read_line.Control.html#TYPEstate">state</a> -> <a href="Lwt_read_line.Terminal.html#TYPEstate">Lwt_read_line.Terminal.state</a></code></pre><div class="info"> Return the rendering state of the given state<br> </div> <pre><span id="VALmake"><span class="keyword">val</span> make</span> : <code class="type">?history:<a href="Lwt_read_line.html#TYPEhistory">Lwt_read_line.history</a> -><br> ?complete:<a href="Lwt_read_line.html#TYPEcompletion">Lwt_read_line.completion</a> -><br> ?clipboard:<a href="Lwt_read_line.clipboard-c.html">Lwt_read_line.clipboard</a> -><br> ?mode:[ `classic | `none | `real_time ] -><br> ?map_text:(Text.t -> Text.t) -><br> ?filter:(<a href="Lwt_read_line.Control.html#TYPEstate">state</a> -><br> <a href="Lwt_read_line.Command.html#TYPEt">Lwt_read_line.Command.t</a> -> <a href="Lwt_read_line.Command.html#TYPEt">Lwt_read_line.Command.t</a> <a href="Lwt.html#TYPEt">Lwt.t</a>) -><br> map_result:(Text.t -> 'a <a href="Lwt.html#TYPEt">Lwt.t</a>) -><br> ?prompt:<a href="Lwt_read_line.Control.html#TYPEprompt">prompt</a> -> unit -> 'a <a href="Lwt_read_line.Control.html#TYPEt">t</a></code></pre><div class="info"> Creates a new read-line instance with the given parameters. <code class="code">filter</code> is called to handle commands. You can return <code class="code"><span class="constructor">Command</span>.<span class="constructor">Nop</span></code> to drop a command.<br> </div> <br> <h6 id="6_Predefinedinstances">Predefined instances</h6><br> <pre><span id="VALread_line"><span class="keyword">val</span> read_line</span> : <code class="type">?history:<a href="Lwt_read_line.html#TYPEhistory">Lwt_read_line.history</a> -><br> ?complete:<a href="Lwt_read_line.html#TYPEcompletion">Lwt_read_line.completion</a> -><br> ?clipboard:<a href="Lwt_read_line.clipboard-c.html">Lwt_read_line.clipboard</a> -><br> ?mode:<a href="Lwt_read_line.html#TYPEcompletion_mode">Lwt_read_line.completion_mode</a> -><br> ?prompt:<a href="Lwt_read_line.Control.html#TYPEprompt">prompt</a> -><br> unit -> Text.t <a href="Lwt_read_line.Control.html#TYPEt">t</a> <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span id="VALread_password"><span class="keyword">val</span> read_password</span> : <code class="type">?clipboard:<a href="Lwt_read_line.clipboard-c.html">Lwt_read_line.clipboard</a> -><br> ?style:<a href="Lwt_read_line.html#TYPEpassword_style">Lwt_read_line.password_style</a> -><br> ?prompt:<a href="Lwt_read_line.Control.html#TYPEprompt">prompt</a> -><br> unit -> Text.t <a href="Lwt_read_line.Control.html#TYPEt">t</a> <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span id="VALread_keyword"><span class="keyword">val</span> read_keyword</span> : <code class="type">?history:<a href="Lwt_read_line.html#TYPEhistory">Lwt_read_line.history</a> -><br> ?case_sensitive:bool -><br> ?mode:<a href="Lwt_read_line.html#TYPEcompletion_mode">Lwt_read_line.completion_mode</a> -><br> ?prompt:<a href="Lwt_read_line.Control.html#TYPEprompt">prompt</a> -><br> values:(Text.t * 'value) list -> unit -> 'value <a href="Lwt_read_line.Control.html#TYPEt">t</a> <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span id="VALread_yes_no"><span class="keyword">val</span> read_yes_no</span> : <code class="type">?history:<a href="Lwt_read_line.html#TYPEhistory">Lwt_read_line.history</a> -><br> ?mode:<a href="Lwt_read_line.html#TYPEcompletion_mode">Lwt_read_line.completion_mode</a> -><br> ?prompt:<a href="Lwt_read_line.Control.html#TYPEprompt">prompt</a> -><br> unit -> bool <a href="Lwt_read_line.Control.html#TYPEt">t</a> <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre></body></html>