pub trait LinkReference:
Number
+ Unsigned
+ ToSigned
+ MaxValue
+ FromPrimitive
+ Debug
+ Display
+ Hash
+ Send
+ Sync
+ 'static { }Expand description
A composite trait for types that can be used as link identifiers.
Combines Number, Unsigned, ToSigned, MaxValue,
FromPrimitive, Debug, Display, Hash, Send, Sync,
and 'static.
Implemented for u8, u16, u32, u64, and usize.
§Examples
use platform_num::LinkReference;
fn create_link<T: LinkReference>(source: T, target: T) -> (T, T) {
(source, target)
}
let link = create_link(1u64, 2u64);
assert_eq!(link, (1u64, 2u64));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.