Drop the Default
bound on the peripheral traits
#176
Labels
➕ improvement
Chores and fixes: the small things.
P-low
Low priority
T-peripheral traits
Topic: Peripheral Traits
what
This was an early design decision we made that, while well-intentioned (the idea, IIRC, was to make the API easier to use; with this bound we'd always be able to provide a
Sim::default()
function), was probably ill-advised.For embedded devices in particular this bound is challenging: most peripheral implementations for devices simply need to reference external state and requiring
Default
makes this impossible without resorting tostatic
s orunsafe
.On hosted platforms, implementing
Default
on peripheral implementations (like the shims) is still desirable and we can still provideDefault
implementations on types likeInterpreter
andSim
by just making those impls contingent on aDefault
boundedPeripherals
type.steps
Default
bound on the peripheral traits: Default
as neededwhere
branch:
imp/drop-default-on-peripheral-traitß
open questions
The text was updated successfully, but these errors were encountered: