Function shadow_rs::new_hook [−][src]
pub fn new_hook<F>(f: F) -> SdResult<()> where
F: FnOnce(&File) -> SdResult<()>,
It's shadow-rs Initialization entry with add custom hook.
In build.rs main()
function call for this function.
Examples
ⓘ
fn main() -> shadow_rs::SdResult<()> { shadow_rs::new_hook(append_write_const) } fn append_write_const(mut file: &File) -> SdResult<()> { let foo: &str = r#"pub const foo: &str = "foo";"#; writeln!(file, "{}", foo)?; Ok(()) }