prop_test.rs 612 B

123456789101112131415161718192021222324
  1. fn main() {}
  2. pub mod dioxus {
  3. pub mod prelude {
  4. pub trait Properties {
  5. type Builder;
  6. const IS_STATIC: bool;
  7. fn builder() -> Self::Builder;
  8. unsafe fn memoize(&self, other: &Self) -> bool;
  9. }
  10. }
  11. }
  12. /// This implementation should require a "PartialEq" because it memoizes (no external references)
  13. #[derive(PartialEq, dioxus_core_macro::Props)]
  14. struct SomeProps {
  15. a: String,
  16. }
  17. /// This implementation does not require a "PartialEq" because it does not memoize
  18. #[derive(dioxus_core_macro::Props)]
  19. struct SomePropsTwo<'a> {
  20. a: &'a str,
  21. }