[−][src]Enum cranelift_codegen::ir::ExternalName
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.
Variants
User
A name in a user-defined symbol table. Cranelift does not interpret these numbers in any way.
Fields of User
TestCase
A test case function name of up to 10 ascii characters. This is not intended to be used outside test cases.
Fields of TestCase
LibCall(LibCall)
A well-known runtime library function.
Methods
impl ExternalName
[src]
pub fn testcase<T: AsRef<[u8]>>(v: T) -> Self
[src]
Creates a new external name from a sequence of bytes. Caller is expected
to guarantee bytes are only ascii alphanumeric or _
.
Examples
// Create `ExternalName` from a string. let name = ExternalName::testcase("hello"); assert_eq!(name.to_string(), "%hello");
pub fn user(namespace: u32, index: u32) -> Self
[src]
Create a new external name from user-provided integer indices.
Examples
// Create `ExternalName` from integer indices let name = ExternalName::user(123, 456); assert_eq!(name.to_string(), "u123:456");
Trait Implementations
impl PartialEq<ExternalName> for ExternalName
[src]
fn eq(&self, other: &ExternalName) -> bool
[src]
fn ne(&self, other: &ExternalName) -> bool
[src]
impl Eq for ExternalName
[src]
impl Display for ExternalName
[src]
impl Debug for ExternalName
[src]
impl FromStr for ExternalName
[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Clone for ExternalName
[src]
fn clone(&self) -> ExternalName
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for ExternalName
[src]
Auto Trait Implementations
impl Unpin for ExternalName
impl Send for ExternalName
impl Sync for ExternalName
impl UnwindSafe for ExternalName
impl RefUnwindSafe for ExternalName
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,