pub trait NativePType:
Send
+ Sync
+ Clone
+ Copy
+ Debug
+ Display
+ Default
+ RefUnwindSafe
+ Num
+ NumCast
+ FromPrimitiveOrF16
+ ToBytes
+ TryFromBytes
+ Sealed
+ 'static {
const PTYPE: PType;
// Required methods
fn is_nan(self) -> bool;
fn is_infinite(self) -> bool;
fn total_compare(self, other: Self) -> Ordering;
fn is_eq(self, other: Self) -> bool;
fn downcast<V: PTypeDowncast>(visitor: V) -> V::Output<Self>;
fn upcast<V: PTypeUpcast>(input: V::Input<Self>) -> V;
// Provided methods
fn is_le(self, other: Self) -> bool { ... }
fn is_lt(self, other: Self) -> bool { ... }
fn is_ge(self, other: Self) -> bool { ... }
fn is_gt(self, other: Self) -> bool { ... }
}Expand description
A trait for native Rust types that correspond 1:1 to a PType.
You can use the match_each_native_ptype macro to help with writing “generic” code over
dynamically typed code.
Required Associated Constants§
Required Methods§
Sourcefn is_nan(self) -> bool
fn is_nan(self) -> bool
Whether this instance (self) is NaN
For integer types, this is always false
Sourcefn is_infinite(self) -> bool
fn is_infinite(self) -> bool
Whether this instance (self) is Infinite
For integer types, this is always false
Sourcefn total_compare(self, other: Self) -> Ordering
fn total_compare(self, other: Self) -> Ordering
Compare another instance of this type to self, providing a total ordering
Sourcefn is_eq(self, other: Self) -> bool
fn is_eq(self, other: Self) -> bool
Whether another instance of this type (other) is bitwise equal to self
Sourcefn downcast<V: PTypeDowncast>(visitor: V) -> V::Output<Self>
fn downcast<V: PTypeDowncast>(visitor: V) -> V::Output<Self>
Downcast the provided object to a type-specific instance.
Sourcefn upcast<V: PTypeUpcast>(input: V::Input<Self>) -> V
fn upcast<V: PTypeUpcast>(input: V::Input<Self>) -> V
Upcast a type-specific instance to a generic instance.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.