pub enum ExternalName {
User {
namespace: u32,
index: u32,
},
TestCase {
length: u8,
ascii: [u8; 16],
},
LibCall(LibCall),
}The name of an external is either a reference to a user-defined symbol
table, or a short sequence of ascii bytes so that test cases do not have
to keep track of a symbol table.
External names are primarily used as keys by code using Cranelift to map
from a cranelift_codegen::ir::FuncRef or similar to additional associated
data.
External names can also serve as a primitive testing and debugging tool.
In particular, many .clif test files use function names to identify
functions.
A name in a user-defined symbol table. Cranelift does not interpret
these numbers in any way.
Fields of User
A test case function name of up to 10 ascii characters. This is
not intended to be used outside test cases.
Fields of TestCase
How many of the bytes in ascii are valid?
A well-known runtime library function.
Creates a new external name from a sequence of bytes. Caller is expected
to guarantee bytes are only ascii alphanumeric or _.
let name = ExternalName::testcase("hello");
assert_eq!(name.to_string(), "%hello");
Create a new external name from user-provided integer indices.
let name = ExternalName::user(123, 456);
assert_eq!(name.to_string(), "u123:456");
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=.
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Performs copy-assignment from source. Read more
Returns the "default value" for a type. Read more
🔬 This is a nightly-only experimental API. (try_from)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from)
🔬 This is a nightly-only experimental API. (try_from)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more