wasmtime_environ::__core

Module primitive

1.43.0 · Source
Expand description

This module reexports the primitive types to allow usage that is not possibly shadowed by other declared types.

This is normally only useful in macro generated code.

An example of this is when generating a new struct and an impl for it:

pub struct bool;

impl QueryId for bool {
    const SOME_PROPERTY: bool = true;
}

Note that the SOME_PROPERTY associated constant would not compile, as its type bool refers to the struct, rather than to the primitive bool type.

A correct implementation could look like:

pub struct bool;

impl QueryId for bool {
    const SOME_PROPERTY: ::core::primitive::bool = true;
}

We also used ::core instead of core, because core can be shadowed, too. Paths, starting with ::, are searched in the extern prelude since Edition 2018.

Re-exports§

pub use bool;
pub use char;
pub use f32;
pub use f64;
pub use i8;
pub use i16;
pub use i32;
pub use i64;
pub use i128;
pub use isize;
pub use str;
pub use u8;
pub use u16;
pub use u32;
pub use u64;
pub use u128;
pub use usize;