Lines Matching +full:visitor +full:- +full:keys
3 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
12 //! feature of toml-rs to use [`IndexMap`] instead.
14 //! [`BTreeMap`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html
44 pub fn new() -> Self { in new()
53 pub fn with_capacity(capacity: usize) -> Self { in with_capacity()
64 pub fn with_capacity(capacity: usize) -> Self { in with_capacity()
81 pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&Value> in get()
94 pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool in contains_key()
107 pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut Value> in get_mut()
115 /// Inserts a key-value pair into the map.
123 pub fn insert(&mut self, k: String, v: Value) -> Option<Value> { in insert()
133 pub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<Value> in remove()
150 F: FnMut(&str, &mut Value) -> bool, in retain()
155 /// Gets the given key's corresponding entry in the map for in-place
157 pub fn entry<S>(&mut self, key: S) -> Entry<'_> in entry()
174 pub fn len(&self) -> usize { in len()
180 pub fn is_empty(&self) -> bool { in is_empty()
186 pub fn iter(&self) -> Iter<'_> { in iter()
194 pub fn iter_mut(&mut self) -> IterMut<'_> { in iter_mut()
200 /// Gets an iterator over the keys of the map.
202 pub fn keys(&self) -> Keys<'_> { in keys() method
203 Keys { in keys()
204 iter: self.map.keys(), in keys()
210 pub fn values(&self) -> Values<'_> { in values()
219 fn default() -> Self { in default()
228 fn clone(&self) -> Self { in clone()
237 fn eq(&self, other: &Self) -> bool { in eq()
251 fn index(&self, index: &Q) -> &Value { in index()
263 fn index_mut(&mut self, index: &Q) -> &mut Value { in index_mut()
270 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { in fmt()
277 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> in serialize()
293 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> in deserialize()
297 struct Visitor; in deserialize() struct
299 impl<'de> de::Visitor<'de> for Visitor { in deserialize() implementation
302 fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { in deserialize()
307 fn visit_unit<E>(self) -> Result<Self::Value, E> in deserialize()
315 fn visit_map<V>(self, mut visitor: V) -> Result<Self::Value, V::Error> in deserialize()
321 while let Some((key, value)) = visitor.next_entry()? { in deserialize()
329 deserializer.deserialize_map(Visitor) in deserialize()
334 fn from_iter<T>(iter: T) -> Self in from_iter()
358 fn next(&mut self) -> Option<Self::Item> {
362 fn size_hint(&self) -> (usize, Option<usize>) {
369 fn next_back(&mut self) -> Option<Self::Item> {
376 fn len(&self) -> usize {
423 pub fn key(&self) -> &String { in key()
432 pub fn or_insert(self, default: Value) -> &'a mut Value { in or_insert()
442 pub fn or_insert_with<F>(self, default: F) -> &'a mut Value in or_insert_with()
444 F: FnOnce() -> Value, in or_insert_with()
457 pub fn key(&self) -> &String { in key()
464 pub fn insert(self, value: Value) -> &'a mut Value { in insert()
472 pub fn key(&self) -> &String { in key()
478 pub fn get(&self) -> &Value { in get()
484 pub fn get_mut(&mut self) -> &mut Value { in get_mut()
490 pub fn into_mut(self) -> &'a mut Value { in into_mut()
497 pub fn insert(&mut self, value: Value) -> Value { in insert()
503 pub fn remove(self) -> Value { in remove()
514 fn into_iter(self) -> Self::IntoIter { in into_iter()
539 fn into_iter(self) -> Self::IntoIter { in into_iter()
564 fn into_iter(self) -> Self::IntoIter { in into_iter()
585 /// An iterator over a toml::Map's keys.
586 pub struct Keys<'a> { struct
591 type KeysImpl<'a> = btree_map::Keys<'a, String, Value>;
593 type KeysImpl<'a> = indexmap::map::Keys<'a, String, Value>;
595 delegate_iterator!((Keys<'a>) => &'a String);