aboutsummaryrefslogtreecommitdiff
path: root/examples/factory/interfaces/user.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-07-22 13:25:45 +0200
committerHampusM <hampus@hampusmat.com>2022-07-22 13:25:45 +0200
commit4cb3884e24b3cba3347ff93475bbabd6fe18d2fa (patch)
tree2fa5e6d81de9dc39bd11d64797914e5d305d98e2 /examples/factory/interfaces/user.rs
parent157f38bc2287dcb9a8b21ef3d5e33c569dc5136e (diff)
refactor: make factories an optional feature
Diffstat (limited to 'examples/factory/interfaces/user.rs')
-rw-r--r--examples/factory/interfaces/user.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/factory/interfaces/user.rs b/examples/factory/interfaces/user.rs
new file mode 100644
index 0000000..70cd632
--- /dev/null
+++ b/examples/factory/interfaces/user.rs
@@ -0,0 +1,13 @@
+use syrette::factory;
+use syrette::interfaces::factory::IFactory;
+
+pub trait IUser
+{
+ fn get_name(&self) -> &'static str;
+ fn get_date_of_birth(&self) -> &'static str;
+ fn get_password(&self) -> &'static str;
+}
+
+#[factory]
+pub type IUserFactory =
+ dyn IFactory<(&'static str, &'static str, &'static str), dyn IUser>;