-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rune: Allow type hashes to be calculated at compile time
- Loading branch information
Showing
36 changed files
with
588 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,43 @@ | ||
//! This crate is only used to build documentation for the `rune-core` crate. | ||
#[cfg(feature = "rune-alloc")] | ||
pub use rune_alloc as alloc; | ||
|
||
#[cfg(feature = "rune-core")] | ||
pub mod item { | ||
#[doc(inline)] | ||
pub use rune_core::item::{Component, ComponentRef, IntoComponent, Item, ItemBuf}; | ||
} | ||
|
||
#[cfg(feature = "rune-core")] | ||
pub mod hash { | ||
#[doc(inline)] | ||
pub use rune_core::hash::{ParametersBuilder, TooManyParameters}; | ||
} | ||
|
||
pub mod support { | ||
pub use anyhow::Error; | ||
pub use anyhow::Result; | ||
} | ||
|
||
pub mod runtime { | ||
use rune_core::hash::Hash; | ||
|
||
pub trait TypeHash { | ||
const HASH: Hash; | ||
} | ||
|
||
impl TypeHash for String { | ||
const HASH: Hash = Hash::new(1); | ||
} | ||
|
||
impl TypeHash for i64 { | ||
const HASH: Hash = Hash::new(2); | ||
} | ||
} | ||
|
||
#[cfg(feature = "rune-core")] | ||
pub use self::runtime::TypeHash; | ||
|
||
#[cfg(feature = "rune-core")] | ||
pub use rune_core::item::{Item, ItemBuf}; |
Oops, something went wrong.