# Design

> The package is a thin layer over UCall's native library, and every rule below follows from that.

1.0.0-rc.1 · b7577426

The package is a thin layer over UCall’s native library, and every rule below follows from that.

- **Verbs share one name across languages.** `TakeCall`, `TakeCalls`, `TakeBatch`, `TakeBatches`, `Submit` and `TakeCompleted` name the same calls as `take_call` and its siblings in C++, Python and Rust.
- **Blocking stays simple, deferring stays symmetric.** A reply that is final on return answers an `error`, and one that may finish later answers `(*Deferred[T], error)`, as Rust’s `Deferring::answer` hands back its refusal before submitting anything.
- **Ownership is a type, not a flag.** A reply takes its `Request`, which the library clears once taken, only a `DetachedRequest` hands back a `Deferred`, and a `Response` is freed by `Close` or the collector.
- **Callbacks cross as handles.** Routes, batch endpoints, log sinks and authorizers reach C as `cgo.Handle` s the server or client deletes when closed, never as Go pointers; a route’s handle holds its handler alone, as each callback receives its server from the library.
- **One pinned frame per call.** Each call pins one allocation holding its outcome, its argument structure and its result, polls included, and a refusal the binding catches allocates only its `Error`, before anything is pinned.
- **No life of its own.** The package starts no goroutines, keeps no locks or counters, and recovers no panics, so it drops into any concurrency model.

| Path | Go | Rust |
| - | - | - |
| Blocking call | 1 frame | 0 |
| Refusal before the call | 1 `Error` | 1 error |
| Deferred submit and wait | 4: frame, `Deferred`, 2 in `AddCleanup` | 0 |
| Each callback | 1 `Request` | 0 |

A completion `TakeCompleted` lifts adds its `Response` and that response’s cleanup, and header lines or reply parts add the one array they cross as. `TestCallsAllocateOnlyTheirFrames` holds the first three rows.
