# `Puck.Sandbox.Runtime.ExecResult`
[🔗](https://github.com/bradleygolden/puck/blob/v0.2.25/lib/puck/sandbox/runtime/exec_result.ex#L1)

Struct representing the result of executing a command in a sandbox.

## Fields

- `stdout` - Standard output from the command
- `stderr` - Standard error from the command
- `exit_code` - Exit code of the command (0 typically means success)

## Examples

    %Puck.Sandbox.Runtime.ExecResult{
      stdout: "hello world",
      stderr: "",
      exit_code: 0
    }

# `t`

```elixir
@type t() :: %Puck.Sandbox.Runtime.ExecResult{
  exit_code: non_neg_integer(),
  stderr: String.t(),
  stdout: String.t()
}
```

# `new`

Creates a new ExecResult with the given attributes.

## Examples

    iex> Puck.Sandbox.Runtime.ExecResult.new(stdout: "hello", exit_code: 0)
    %Puck.Sandbox.Runtime.ExecResult{stdout: "hello", stderr: "", exit_code: 0}

# `output`

Returns the output (stdout if present, otherwise stderr).

Useful when you just want the command output regardless of stream.

## Examples

    iex> result = Puck.Sandbox.Runtime.ExecResult.new(stdout: "hello", exit_code: 0)
    iex> Puck.Sandbox.Runtime.ExecResult.output(result)
    "hello"

    iex> result = Puck.Sandbox.Runtime.ExecResult.new(stderr: "error message", exit_code: 1)
    iex> Puck.Sandbox.Runtime.ExecResult.output(result)
    "error message"

# `success?`

Returns true if the command executed successfully (exit code 0).

## Examples

    iex> result = Puck.Sandbox.Runtime.ExecResult.new(exit_code: 0)
    iex> Puck.Sandbox.Runtime.ExecResult.success?(result)
    true

    iex> result = Puck.Sandbox.Runtime.ExecResult.new(exit_code: 1)
    iex> Puck.Sandbox.Runtime.ExecResult.success?(result)
    false

---

*Consult [api-reference.md](api-reference.md) for complete listing*
