# with_restart_policy

Set restart policy for the container.

```rhai
container.with_restart_policy(policy) -> Container
```

## Parameters

- `policy` (string): Restart policy ("no", "always", "on-failure", "unless-stopped")

## Returns

Returns the `Container` builder for method chaining.

## Examples

```rhai
// Always restart
let container = nerdctl_container_from_image("app", "myapp:latest")
    .with_restart_policy("always")
    .build();

// Restart only on failure
let container2 = nerdctl_container_from_image("worker", "worker:latest")
    .with_restart_policy("on-failure")
    .build();
```

## Notes

- This is a chainable method
- Policies:
  - "no": Do not restart
  - "always": Always restart
  - "on-failure": Restart only if container exits with error
  - "unless-stopped": Always restart unless manually stopped
