pub trait ConstantValue: Sized {
// Provided methods
fn string(index: u32) -> Option<Self> { ... }
fn function(index: u32) -> Option<Self> { ... }
fn string_index(&self) -> Option<u32> { ... }
fn function_index(&self) -> Option<u32> { ... }
}Expand description
A value that can live in the constant pool of a standard header.
.const str "text" and .const fn @name are assembled through
string and function; a value model
without string or function constants returns None and such directives
are rejected. string_index and
function_index report the table references of
a value, so that a hand-written index such as .const str 3 is rejected
and tools can explain constants.
Provided Methods§
Sourcefn string_index(&self) -> Option<u32>
fn string_index(&self) -> Option<u32>
The strings index this constant refers to, if any.
Sourcefn function_index(&self) -> Option<u32>
fn function_index(&self) -> Option<u32>
The functions index this constant refers to, if any.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".