diff --git a/lib/tools/common-tools/src/lib.rs b/lib/tools/common-tools/src/lib.rs index 56b827acd788c980da9fa488a270efef4ccd4525..17c4969bfbed5cf48fb6a1fa0cd49245ca418bfe 100644 --- a/lib/tools/common-tools/src/lib.rs +++ b/lib/tools/common-tools/src/lib.rs @@ -28,4 +28,4 @@ pub mod fns; pub mod macros; -use std::io::Write; +pub mod traits; diff --git a/lib/tools/common-tools/src/traits/merge.rs b/lib/tools/common-tools/src/traits/merge.rs new file mode 100644 index 0000000000000000000000000000000000000000..31ac75376d6775f46d6c5c415d3642a6d346cf2c --- /dev/null +++ b/lib/tools/common-tools/src/traits/merge.rs @@ -0,0 +1,22 @@ +// Copyright (C) 2019 Éloïs SANCHEZ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <https://www.gnu.org/licenses/>. + +//! Trait Merge. + +/// Merge two instances of same type +pub trait Merge { + /// Merge two instances of same type + fn merge(self, other: Self) -> Self; +} diff --git a/lib/tools/common-tools/src/traits/mod.rs b/lib/tools/common-tools/src/traits/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..f3f2049fbe4ef765faf8ff48f3aa00b5700d93ed --- /dev/null +++ b/lib/tools/common-tools/src/traits/mod.rs @@ -0,0 +1,18 @@ +// Copyright (C) 2019 Éloïs SANCHEZ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <https://www.gnu.org/licenses/>. + +//! Common rust traits for DURS project. + +pub mod merge;