feat!: non-exhaustive public error enums, build-time E2E caps (0.11.0) - #150
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #150 +/- ##
==========================================
- Coverage 81.26% 81.25% -0.01%
==========================================
Files 46 46
Lines 15470 15470
==========================================
- Hits 12571 12570 -1
- Misses 2899 2900 +1
|
…configurable Closes #144. Closes #147. `client::Error`, `server::Error`, `e2e::Error`, `protocol::Error`, and `protocol::sd::Error` gain `#[non_exhaustive]`; `transport::TransportError` already had it. `client::Error` carried a stability note asserting the opposite and spelling out the cost it accepted — that any added variant is a breaking change. Removing that cost is the point: pre-1.0 with an active cadence, every added variant broke every downstream match, including consumers who only ever wanted a catch-all. `E2E_REGISTRY_CAP` and `E2E_RX_STATE_CAP` now read `SIMPLE_SOMEIP_E2E_REGISTRY_CAP` / `SIMPLE_SOMEIP_E2E_RX_STATE_CAP` through the `from_env_or` mechanism their siblings already used. Defaults unchanged, so that half is additive. `E2E_RX_STATE_CAP` is the one that wanted it: receive state is keyed `(source, key)`, so it bounds sources x keys, and a node demuxing many senders could not raise it without vendoring the crate. Two consequences worth noting: `from_env_or` loses its `server`/`client` cfg gate. `e2e` compiles unconditionally, so the gate would have broken `--no-default-features` the moment the caps started using it — and there is now no configuration in which the function is dead code. The power-of-two `const _` assertions become load-bearing rather than defensive: a non-power-of-two supplied through the env var fails the build instead of silently mis-sizing the FnvIndexMap. Verified, along with the non-digit guard. `simple-someip-embassy-net` carries an explicit version req next to its path dependency, so the 0.11.0 bump is a two-part change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JustinKovacich
force-pushed
the
feat/error-surface-and-caps
branch
from
August 21, 2026 13:35
ecd4697 to
ecb337f
Compare
zheylmun
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #144. Closes #147.
The first of the batch raised against the 0.10.0 surface. These two travel together because both land as 0.11.0 and both touch the "what can a consumer configure or match on" surface; #145, #146 and #148 follow separately.
#[non_exhaustive]on the public error enums (#144) — breakingApplied to
client::Error,server::Error,e2e::Error,protocol::Error, andprotocol::sd::Error.transport::TransportErroralready had it — so this makes the treatment uniform rather than introducing it.Six enums, not the five the issue named:
protocol::sd::Errorturned up in the sweep.client::Error's doc carried a stability note asserting the opposite, and honestly spelling out the cost it was accepting — "any new variant added here is a breaking change." That note is rewritten rather than deleted, because the reasoning is still worth stating, just with the conclusion inverted.Build-time E2E caps (#147) — additive
E2E_REGISTRY_CAPandE2E_RX_STATE_CAPnow go throughfrom_env_or, matchingSERVICE_REGISTRY_CAP, the server caps, and the bare-metal runtime. Defaults unchanged at 32 and 64.Verified all three paths, not just the happy one:
SIMPLE_SOMEIP_E2E_RX_STATE_CAP=128SIMPLE_SOMEIP_E2E_RX_STATE_CAP=100E2E_RX_STATE_CAP must be a power of two for heapless::FnvIndexMapSIMPLE_SOMEIP_E2E_REGISTRY_CAP=abcThe power-of-two
const _assertions were previously defensive against a future edit; they are now load-bearing against user input, which is worth being deliberate about — a non-power-of-two fails the build rather than silently mis-sizing the map.Two things reviewers should look at
from_env_orloses its#[cfg(any(feature = "server", feature = "client"))]gate. That gate existed because every caller lived in one of those modules and it would otherwise be dead code.e2eis compiled unconditionally, so once the caps use it the gate breaks--no-default-featuresoutright — and there is no longer any configuration in which the function is dead. Caught by building that config; it is in the verification list below for that reason.The 0.11.0 bump is two-part.
simple-someip-embassy-netcarriesversion = "0.11"next to itspath = ".."dependency, so bumping only the rootCargo.tomlfails resolution for the whole workspace. Same shape as the version bump in 0.10.0.Also corrected in passing:
from_env_or's non-digit assert saidSIMPLE_SOMEIP_MAX_*, which only covers one of the two var families (MAX_OFFERS/MAX_SUBSvs the*_CAPset). It now saysSIMPLE_SOMEIP_*and the doc names both.Verification
cargo clippy -- -D warnings -D clippy::pedanticon all five lanes CI runs: the alloc/host workspace lane,--no-default-features, and the threebare_metalcombinations.cargo test --no-default-features— CI's test lane — green.cargo doc --no-depswithRUSTDOCFLAGS=-D warningsforclient,server,bare_metal, and the alloc set. This is what caught an intra-doc link I had first written into the newe2edocs pointing atclient::SERVICE_REGISTRY_CAP, which is behind a feature thee2emodule does not have.cargo fmt --all -- --checkclean.--no-default-featuresbuilds — the configuration the cfg-gate change is about.Unrelated, but noting it since it is visible if you run the full suite:
cargo test --workspace --features $ALLOC_FEATURESfails 12 subscriber tests on unmodifiedmainas well. That combination is not one CI's test lane runs. Not touched by this branch, and not investigated here.