Function std::intrinsics::type_id[][src]

pub const extern "rust-intrinsic" fn type_id<T>() -> u64 where
    T: 'static + ?Sized
🔬 This is a nightly-only experimental API. (core_intrinsics)

intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library

Expand description

获取一个标识符,该标识符对于指定的类型是全局唯一的。 无论调用哪个 crate,此函数都将为类型返回相同的值。

请注意,与大多数内联函数不同,这对调用是安全的; 它不需要 unsafe 块。 因此,实现不得要求用户维护任何安全不可变变量。

这个 intrinsic 的稳定版本是 core::any::TypeId::of