value: Implement Value for BTreeMap
@@ -4,7 +4,7 @@ use chrono::prelude::*;
use chrono::Duration;
use num_bigint::BigInt;
use std::borrow::Cow;
-use std::collections::{BTreeSet, HashMap, HashSet};
+use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::convert::TryInto;
use std::net::IpAddr;
use thiserror::Error;
@@ -485,6 +485,12 @@ impl<V: Value> Value for BTreeSet<V> {
}
}
+impl<K: Value, V: Value> Value for BTreeMap<K, V> {
+ fn serialize(&self, buf: &mut Vec<u8>) -> Result<(), ValueTooBig> {
+ serialize_map(self.iter(), self.len(), buf)
+ }
+}
+
impl<T: Value> Value for Vec<T> {
fn serialize(&self, buf: &mut Vec<u8>) -> Result<(), ValueTooBig> {
serialize_list_or_set(self.iter(), self.len(), buf)
