aboutsummaryrefslogtreecommitdiff
path: root/syrette_macros/src/declare_interface_args.rs
diff options
context:
space:
mode:
Diffstat (limited to 'syrette_macros/src/declare_interface_args.rs')
-rw-r--r--syrette_macros/src/declare_interface_args.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/syrette_macros/src/declare_interface_args.rs b/syrette_macros/src/declare_interface_args.rs
new file mode 100644
index 0000000..b54f458
--- /dev/null
+++ b/syrette_macros/src/declare_interface_args.rs
@@ -0,0 +1,23 @@
+use syn::parse::{Parse, ParseStream, Result};
+use syn::{Path, Token, Type};
+
+pub struct DeclareInterfaceArgs
+{
+ pub implementation: Type,
+ pub interface: Path,
+}
+
+impl Parse for DeclareInterfaceArgs
+{
+ fn parse(input: ParseStream) -> Result<Self>
+ {
+ let implementation: Type = input.parse()?;
+
+ input.parse::<Token![->]>()?;
+
+ Ok(Self {
+ implementation,
+ interface: input.parse()?,
+ })
+ }
+}