aboutsummaryrefslogtreecommitdiff
path: root/examples/generics/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'examples/generics/interfaces')
-rw-r--r--examples/generics/interfaces/mod.rs1
-rw-r--r--examples/generics/interfaces/printer.rs6
2 files changed, 7 insertions, 0 deletions
diff --git a/examples/generics/interfaces/mod.rs b/examples/generics/interfaces/mod.rs
new file mode 100644
index 0000000..3f31bdf
--- /dev/null
+++ b/examples/generics/interfaces/mod.rs
@@ -0,0 +1 @@
+pub mod printer;
diff --git a/examples/generics/interfaces/printer.rs b/examples/generics/interfaces/printer.rs
new file mode 100644
index 0000000..3098d0b
--- /dev/null
+++ b/examples/generics/interfaces/printer.rs
@@ -0,0 +1,6 @@
+use std::fmt::Display;
+
+pub trait IPrinter<Printable: Display>
+{
+ fn print(&self, out: Printable);
+}