2
0
Fork 0
mirror of https://github.com/DioxusLabs/dioxus synced 2024-12-25 20:13:09 +00:00
dioxus/packages/core-macro/examples/prop_test.rs

25 lines
612 B
Rust
Raw Normal View History

fn main() {}
pub mod dioxus {
pub mod prelude {
pub trait Properties {
type Builder;
2021-08-08 19:15:16 +00:00
const IS_STATIC: bool;
fn builder() -> Self::Builder;
unsafe fn memoize(&self, other: &Self) -> bool;
}
}
}
/// This implementation should require a "PartialEq" because it memoizes (no external references)
#[derive(PartialEq, dioxus_core_macro::Props)]
struct SomeProps {
a: String,
}
/// This implementation does not require a "PartialEq" because it does not memoize
#[derive(dioxus_core_macro::Props)]
struct SomePropsTwo<'a> {
a: &'a str,
}