Trait Token

Source
pub unsafe trait Token:
    Copy
    + From<Self>
    + Into<Self> {
    // Required methods
    fn new() -> Option<Self>;
    unsafe fn new_unchecked() -> Self;
}
Expand description

Indicates support for a particular CPU feature.

§Safety

Implementing Token for a type indicates that the type is only constructible when the associated CPU features are supported.

Required Methods§

Source

fn new() -> Option<Self>

Detects whether the required CPU features are supported.

Source

unsafe fn new_unchecked() -> Self

Creates the token without detecting if the CPU features are supported.

§Safety

Calling this function causes undefined behavior if the required CPU features are not supported.

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§