Skip to main content

Id

Trait Id 

Source
pub trait Id:
    Copy
    + Clone
    + Eq
    + PartialEq
    + Debug
    + Into<u64>
    + From<u64> {
    // Provided methods
    fn as_u64(&self) -> u64 { ... }
    fn from_u64(val: u64) -> Self { ... }
}
Expand description

Id 基础 trait,所有自定义 Id 需实现此 trait

Provided Methods§

Source

fn as_u64(&self) -> u64

快速转换为 u64

Source

fn from_u64(val: u64) -> Self

从 u64 构建 Id

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.

Implementors§