kataru/traits/mod.rs
1use crate::Result;
2
3mod file;
4mod text;
5
6pub use file::{Load, LoadMessagePack, LoadYaml, Save, SaveMessagePack, SaveYaml};
7pub use text::{FromMessagePack, FromStr, FromYaml, IntoStr};
8
9/// Trait to merge two objects together. Used for maps.
10pub trait Merge: Sized {
11 fn merge(&mut self, other: &mut Self) -> Result<()>;
12}
13
14/// Trait to merge two objects together. Used for maps.
15pub trait CopyMerge: Sized + Clone {
16 fn copy_merge(&self, other: &Self) -> Result<Self>;
17}
18
19/// Trait to move values from one object objects together. Used for maps.
20pub trait MoveValues: Sized {
21 #[allow(dead_code)]
22 fn move_values(other: &mut Self) -> Result<Self>;
23}