Conversation
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.
Summary
Many signatures demanded one concrete type (
&[u8],&str,Vec<T>,Box<dyn T>), so callers holding an owned value, an array, or a concrete implementor had to convert first. Parameters now takeAsRef,Into,IntoIterator, orimpl Traitper the house flexible-arguments rule, except where a dyn-compatible trait method or a fixed crypto role requires the concrete type.Related Issues
None
Changes Made
Vecdecodeaccepts any byte source, including a bare&[u8]Testing
make test-all: passesBreaking Changes
ServletRegistry::insertandTrustBuilder::with_chainare generic.with_sink,with_analyzer,with_rng, andLoggerConfig::newtake the value itself.Arc::neworBox::newwrapper.Note
Medium Risk
Widened trait methods are a breaking change for external implementors; runtime logic is largely unchanged, but the breadth of colony/crypto/cluster touchpoints increases regression surface.
Overview
Breaking API ergonomics refactor: parameters across the crate (and
tightbeam-derive) now takeAsRef,Into, orIntoIteratorinstead of fixed&[u8],&str,Vec<T>, or caller-suppliedBox/Arcwrappers.Call sites can pass literals, owned buffers, and arrays directly—e.g. cluster registry lookups use
type_key("ping")without extra references, gossip helpers accept array slices, and framewith_rngboxes animpl CryptoRngCoreinternally. Docs showStdoutBackendwithoutBox::new. Fuzz/colony paths gain the same flexibility for IDs, dial addresses, and advertisement type lists.Trait surface breaks: widened methods on
ServletRegistry(hive) andTrustBuilder::with_chain(and similar) are no longer dyn-compatible—custom implementors must match the new generic signatures.wcet!/ timing builders pass analyzers withoutArc::newwhere the API now accepts the value directly.Behavior at boundaries is unchanged aside from internal
.into()/.collect(); the diff is mostly signature widening plus test and call-site cleanup.Reviewed by Cursor Bugbot for commit 9fc73d7. Bugbot is set up for automated code reviews on this repo. Configure here.