# tcontract-exec
Execution resources of the tcontract stack: scratch memory and contraction
policy. It starts no task and exposes no scheduler type. Where tasks run, and how
many at once, belongs to [`strided-exec`](https://crates.io/crates/strided-exec)
(strided-rs 0.7); this crate adds what is specific to contraction.
| `Pool<'p>` | A `strided_exec::Pool` (borrowed with `Pool::borrow`, owned with `Pool::owned`, or shared by several wrappers with `Pool::shared`) plus the retained scratch arena. One wrapper is one workspace owner: keep it across calls. |
| `Exec<'a>` | The per-call resource bundle: one `strided_exec::Exec` token, an optional workspace, and the `BatchPolicy`. Not `Clone`, not `Copy`; operations take `&mut Exec`. |
| `ArenaProvider`, `Workspace`, `WorkspaceReq`, `TeamLease` | Reusable scratch, owned by a `Pool` or lent by a serial caller. |
| `BatchPolicy`, `BatchQuery`, `BatchDecision`, `batch_decision`, `WorkModel` | The one lane decision (`lanes * item_threads <= budget`) every batch-owning operation shares. |
| `WidthPolicy`, `Exec::width_for` | The partition width for work estimated at `serial_ns`. |
## `Exec`
```rust
use tcontract_exec::{Exec, Pool};
let sp = strided_exec::Pool::builder().threads(4).build()?; // the host owns the pool
let pool = Pool::borrow(&sp); // wrapper: pool + scratch arena
let mut exec = Exec::new(&pool, 4)?; // the only budget clamp