-
Notifications
You must be signed in to change notification settings - Fork 0
Description
There are 3 key crates in this plan: libstd, abstract_platform, and platform (e.g. platform_unix).
-
libstd links to the abstract_platform and a platform crate. Almost all libstd types wrap around their counterpart in abstract_platform, instancing them via the platform impl.
This crate needs to make sure to only interact with the platform crate via the abstract_platform types, with the exception of statics and the ext module.
No assumptions over any of the types provided byplatform
may be made.
To allow a smoother transition, this will be implemented completely inside of::sys
at first. -
abstract_platform provides traits deacribing the required types, functions and constants to be provided by a platform crate. Furthermore it provides almost all types of libstd but generic over the platform (using the aforementioned traits). Statics can't be generic, so they can't be formalized via a trait and thus need to follow an informal contract (probably described in the crate doc).
-
platform provides a platform implementation by implementing the traits and statics from abstract_platform.
Platform specific extensions may be provided at::ext
via a platform specific contract.
This crate needs to take care not to export any items except::Std
(which needs to implementabstract_platform::traits::Std
), required statics and an optionalext
module.
::Std
must be either an empty struct or an empty enum.