Module conch_runtime::spawn [] [src]

Defines methods for spawning commands into futures.

Modules

ast_impl

This module defines various Spawn implementations on AST types defined by the conch-parser crate.

builtin

Defines methods for spawning shell builtin commands

Structs

AndOrList

A future representing the execution of a list of And/Or commands.

Case

A future representing the execution of a case command.

For

A future representing the execution of a for loop command.

ForArgs

A future representing the execution of a for loop command.

Function

A future that represents the execution of a function registered in an environment.

GuardBodyPair

A grouping of guard and body commands.

If

A future representing the execution of an if command.

LocalRedirections

A future representing the spawning of a command with some local redirections.

Loop

A future representing the execution of a loop (e.g. while/until) command.

PatternBodyPair

A grouping of patterns and body commands.

Pipeline

A future representing the spawning of a pipeline of commands.

Sequence

A future that represents the sequential execution of commands.

SimpleCommand

A future representing the spawning of a simple or regular command.

SpawnedPipeline

A future representing a fully spawned of a pipeline of commands.

SpawnedSimpleCommand

A future representing the fully spawned of a simple command.

Subshell

A future that represents the sequential execution of commands in a subshell environment.

Substitution

A future that represents the execution of a command substitution.

SubstitutionEnvFuture

A future that represents the spawning of a command substitution.

SwallowNonFatal

A future representing a word evaluation and conditionally splitting it afterwards.

Enums

AndOr

A command which conditionally runs based on the exit status of the previous command.

ExitResult

Represents either a ready ExitStatus or a future that will resolve to one.

Traits

Ref

A marker trait for any reference.

Spawn

A trait for spawning commands into an EnvFuture which can be polled to completion.

SpawnBoxed

A trait for spawning commands (without moving ownership) into boxed futures. Largely useful for having spawnable trait objects.

SpawnRef

A marker trait for denoting that the receiver of a Spawn implementation can also be spawned by reference without moving. Automatically derived for any &'a T: Spawn.

Functions

and_or_list

Spawns an And/Or list of commands from an initial command and an iterator.

case

Spawns a Case commands from a word to match number of case arms.

for_args

Spawns a for loop with the environment's currently set arguments.

for_loop

Spawns a for loop with all the fields when words are evaluated, or with the environment's currently set arguments if no words are specified.

for_with_args

Spawns a for loop with the specified arguments.

function

Creates a future adapter that will attempt to execute a function (if it has been defined) with a given set of arguments.

function_body

Creates a future adapter that will execute a function body with the given set of arguments.

if_cmd

Spawns an If commands from number of conditional branches.

loop_cmd

Spawns a loop command such as While or Until using a guard and a body.

pipeline

Spawns a pipeline of commands.

sequence

Spawns any iterable collection of sequential items.

simple_command

Spawns a shell command (or function) after applying any redirects and environment variable assignments.

spawn_with_local_redirections

Creates a future which will evaluate a number of local redirects before spawning the inner command.

subshell

Spawns any iterable collection of sequential items as if they were running in a subshell environment.

substitution

Spawns any iterable collection of sequential items whose standard output will be captured (and trailing newlines trimmed).

swallow_non_fatal_errors

Creates a future adapter that will swallow (and report) non-fatal errors and resolve to EXIT_ERROR if they arise.

Type Definitions

BoxSpawnEnvFuture

Type alias for boxed futures that represent spawning a command.

BoxStatusFuture

Type alias for a boxed future which will resolve to an ExitStatus.