Trait fixed::traits::FixedOptionalFeatures
source · pub trait FixedOptionalFeatures: Sealedwhere
Self: for<'a> Arbitrary<'a> + BorshSerialize + BorshDeserialize + Zero + Bounded + Inv + CheckedAdd + CheckedSub + CheckedNeg + CheckedMul + CheckedDiv + CheckedRem + CheckedShl + CheckedShr + SaturatingAdd + SaturatingSub + SaturatingMul + WrappingAdd + WrappingSub + WrappingNeg + WrappingMul + WrappingShl + WrappingShr + OverflowingAdd + OverflowingSub + OverflowingMul + ToPrimitive + FromPrimitive + FloatConst + Serialize + for<'de> Deserialize<'de>,{ }Expand description
This trait is used to provide supertraits to the Fixed trait
depending on the crate’s optional features, and should not be used directly.
-
If the
arbitraryfeature is enabled,Arbitraryis a supertrait ofFixed. -
If the
borshexperimental feature is enabled,BorshSerializeandBorshDeserializeare supertraits ofFixed. -
If the
num-traitsexperimental feature is enabled, the following are supertraits ofFixed:ZeroBoundedInvCheckedAdd,CheckedSub,CheckedNeg,CheckedMul,CheckedDiv,CheckedRem,CheckedShl,CheckedShrSaturatingAdd,SaturatingSub,SaturatingMulWrappingAdd,WrappingSub,WrappingNeg,WrappingMul,WrappingShl,WrappingShrOverflowingAdd,OverflowingSub,OverflowingMulToPrimitive,FromPrimitiveFloatConst
The following are not supertraits of
Fixed, even though they are implemented for fixed-point numbers where applicable:Onebecause not all fixed-point numbers can represent the value 1Numbecause it hasOneas a supertraitMulAdd,MulAddAssignbecauseMulAdd::mul_addconflicts withFixed::mul_add
Similarly,
SignedandUnsignedare not supertraits ofFixedSignedandFixedUnsignedbecause they haveNumas a supertrait. -
If the
serdefeature is enabled,SerializeandDeserializeare supertraits ofFixed.
Object Safety§
This trait is not object safe.