Trait GpuName

Source
pub trait GpuName {
    // Required method
    fn name() -> String;
}
Expand description

The name that is used in the GPU source code to identify the item that is used.

Required Methods§

Source

fn name() -> String

A unique name for the item.

To make the uniqueness easier to implement, use the name macro. It produces a unique name, based on the module path and the type of the item itself. That identifier might not be stable across different versions of a crate, but this is OK as kernel sources/binaries are always bundled with a library and not re-used between versions.

§Example
struct Fp;

impl ec_gpu::GpuName for Fp {
    fn name() -> String {
        ec_gpu::name!()
    }
}

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§