1use toml::Value;
12
13use crate::delete::TomlValueDeleteExt;
14use crate::error::Result;
15use crate::insert::TomlValueInsertExt;
16use crate::read::TomlValueReadExt;
17use crate::set::TomlValueSetExt;
18
19pub trait TomlValueExt<'doc>:
28 TomlValueReadExt<'doc> + TomlValueSetExt + TomlValueDeleteExt + TomlValueInsertExt
29{
30 #[inline]
36 fn read_with_seperator(&'doc self, query: &str, sep: char) -> Result<Option<&'doc Value>> {
37 TomlValueReadExt::read_with_seperator(self, query, sep)
38 }
39
40 #[inline]
42 fn read_mut_with_seperator(
43 &'doc mut self,
44 query: &str,
45 sep: char,
46 ) -> Result<Option<&'doc mut Value>> {
47 TomlValueReadExt::read_mut_with_seperator(self, query, sep)
48 }
49
50 #[inline]
52 fn read(&'doc self, query: &str) -> Result<Option<&'doc Value>> {
53 TomlValueReadExt::read_with_seperator(self, query, '.')
54 }
55
56 #[inline]
58 fn read_mut(&'doc mut self, query: &str) -> Result<Option<&'doc mut Value>> {
59 TomlValueReadExt::read_mut_with_seperator(self, query, '.')
60 }
61
62 #[inline]
68 fn set_with_seperator(
69 &mut self,
70 query: &str,
71 sep: char,
72 value: Value,
73 ) -> Result<Option<Value>> {
74 TomlValueSetExt::set_with_seperator(self, query, sep, value)
75 }
76
77 #[inline]
79 fn set(&mut self, query: &str, value: Value) -> Result<Option<Value>> {
80 TomlValueSetExt::set_with_seperator(self, query, '.', value)
81 }
82
83 #[inline]
89 fn delete_with_seperator(&mut self, query: &str, sep: char) -> Result<Option<Value>> {
90 TomlValueDeleteExt::delete_with_seperator(self, query, sep)
91 }
92
93 #[inline]
95 fn delete(&mut self, query: &str) -> Result<Option<Value>> {
96 TomlValueDeleteExt::delete(self, query)
97 }
98
99 #[inline]
105 fn insert_with_seperator(
106 &mut self,
107 query: &str,
108 sep: char,
109 value: Value,
110 ) -> Result<Option<Value>> {
111 TomlValueInsertExt::insert_with_seperator(self, query, sep, value)
112 }
113
114 #[inline]
116 fn insert(&mut self, query: &str, value: Value) -> Result<Option<Value>> {
117 TomlValueInsertExt::insert(self, query, value)
118 }
119}
120
121impl<'doc> TomlValueExt<'doc> for Value {}