-
-
Notifications
You must be signed in to change notification settings - Fork 957
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial work to rewrite the elements logic for hotreload
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,7 @@ pub use js::*; | |
mod asset; | ||
pub use asset::*; | ||
|
||
mod metadata; | ||
pub use metadata::*; | ||
|
||
pub mod linker; |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use const_serialize::{ConstStr, SerializeConst}; | ||
use std::path::PathBuf; | ||
|
||
#[derive( | ||
Debug, | ||
PartialEq, | ||
PartialOrd, | ||
Clone, | ||
Copy, | ||
Hash, | ||
SerializeConst, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
)] | ||
pub struct Metadata { | ||
key: ConstStr, | ||
value: ConstStr, | ||
keep_link_section: fn() -> u8, | ||
} | ||
|
||
impl Metadata { | ||
#[doc(hidden)] | ||
/// This should only be called from the macro | ||
/// Create a new metadata | ||
pub const fn new(key: &'static str, value: &'static str, keep_link_section: fn() -> u8) -> Self { | ||
Self { | ||
key: ConstStr::new(key), | ||
value: ConstStr::new(value), | ||
keep_link_section, | ||
} | ||
} | ||
} |
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