repe-core
The RepeStruct surface of repe, on its own: the trait a served struct implements, the error type it reports, the response body it encodes into, and the protocol constants those two name.
Depend on this instead of repe when the crate that declares a served type is not the crate that serves it. A pure-logic crate — no I/O, no unsafe, buildable on any host — can derive RepeStruct on its types from here without acquiring a server, a client, or a transport. The crate that actually runs the RPC depends on repe, which re-exports everything here, so the two halves name the same trait.
[]
= "2"
# Only what the source below actually names. The derive reaches `serde_json`
# through `repe-core`, so it is not a dependency of yours.
= { = "1", = ["derive"] }
use RepeStruct;
Everything in this crate is re-exported by repe at the same paths (repe::structs::*, repe::constants::*), so a type derived against repe-core mounts on a repe::Router with nothing in between.
Features
typed, off by default, adds ResponseBody::write_typed_slice — the BEVE typed-numeric array encoding a #[repe(typed)] field is read as — and with it beve and the six packages behind it: bytemuck, half, cfg-if, simdutf8, zerocopy and zerocopy-derive.
It is off because that encoder is the whole weight of this crate. Without it the dependency list is serde, serde_json and thiserror, which is the point of depending here rather than on repe. A struct with no #[repe(typed)] field compiles identically either way; one that has such a field gets a compile error naming the feature, never a silent fallback to a JSON array.
= { = "2", = ["typed"] }
repe enables it, so a crate depending on repe needs no opt-in.
See the repe documentation for the server, the client, and the protocol.