Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
rexpect
Spawn, control, and respond to expected patterns of child applications and processes, enabling the automation of interactions and testing. Components include:
- session: start a new process and interact with it; primary module of rexpect.
- reader: non-blocking reader, which supports waiting for strings, regex, and EOF.
- process: spawn a process in a pty.
The goal is to offer a similar set of functionality as pexpect.
Examples
For more examples, check the examples directory.
Basic usage
Simple example for interacting via ftp:
use spawn;
use *;
Example with bash and reading from programs
use spawn_bash;
use *;
Example with bash and job control
One frequent bitfall with sending ctrl-c and friends is that you need to somehow ensure that the program has fully loaded, otherwise the ctrl-* goes into nirvana. There are two functions to ensure that:
executewhere you need to provide a match string which is present on stdout/stderr when the program is readywait_for_promptwhich waits until the prompt is shown again
use spawn_bash;
use *;
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.