diff options
author | HampusM <hampus@hampusmat.com> | 2022-07-24 15:58:30 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-07-24 15:58:30 +0200 |
commit | 5335cdad99a6d566ea6e83f97012c7954ba93c45 (patch) | |
tree | b4c91634b34f6d3858d6dd210afb609d9a1f76d7 /examples/generics/interfaces | |
parent | 5ea16d1e5bf716831bc8c54c5c4c86229d7e0463 (diff) |
feat: add support for generics
Diffstat (limited to 'examples/generics/interfaces')
-rw-r--r-- | examples/generics/interfaces/mod.rs | 1 | ||||
-rw-r--r-- | examples/generics/interfaces/printer.rs | 6 |
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); +} |