From 4ee8cfbafaaf89eaa3e13e949371c7fc0f6d8fac Mon Sep 17 00:00:00 2001 From: Intege-rs Date: Tue, 19 Nov 2024 02:04:05 -0500 Subject: [PATCH] the from repr trait --- x/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x/src/lib.rs b/x/src/lib.rs index fbf5c87..b6d5aed 100644 --- a/x/src/lib.rs +++ b/x/src/lib.rs @@ -24,4 +24,10 @@ import!(sub_xpat, xpat, "xpat"); #[cfg(feature = "macros")] pub use sub_macros::{ FromRepr -}; \ No newline at end of file +}; + +#[cfg(feature = "macros")] +pub trait FromRepr: Sized { + type Repr; + fn from_repr(repr: Self::Repr) -> Option; +} \ No newline at end of file