ProbablyPortable
: A potential protector against platform peculiarities
#1262
Labels
enhancement
New feature or request
ProbablyPortable
: A potential protector against platform peculiarities
#1262
I propose a safe, derivable
ProbablyPortable
trait, which provides a (very good) best-effort analysis and marker of probable portability. If a type isProbablyPortable
it probably:We will provide base implementations of
ProbablyPortable
for()
,bool
,i8
,u8
, and zerocopy's endian-aware types. An implementation is also provided for arrays ofProbablyPortable
elements.derive(ProbablyPortable)
can be applied to:repr(C)
orrepr(transparent)
, whose members areProbablyPortable
ProbablyPortable
The documentation of
ProbablyPortable
will instruct users that it should not be derived on types whose APIs are endian aware in non-portable ways. However, it is not, strictly speaking, a violation ofProbablyPortable
's contract to do so — the proposed trait is calledProbablyPortable
, notPortable
, because aderive
cannot guarantee this.The text was updated successfully, but these errors were encountered: