pub struct Map<K, V>(/* private fields */);
Expand description
This serializes a list of tuples into a map
Normally, you want to use a HashMap
or a BTreeMap
when deserializing a map.
However, sometimes this is not possible due to type constraints, e.g., if the type implements neither Hash
nor Ord
.
Another use case is deserializing a map with duplicate keys.
§Examples
Wrapper
does not implement Hash
nor Ord
, thus prohibiting the use HashMap
or BTreeMap
.
The JSON also contains a duplicate key.
#[serde_as]
#[derive(Debug, Deserialize, Serialize, Default)]
struct S {
#[serde_as(as = "Map<_, _>")]
s: Vec<(Wrapper<i32>, String)>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(transparent)]
struct Wrapper<T>(T);
let data = S {
s: vec![
(Wrapper(1), "a".to_string()),
(Wrapper(2), "b".to_string()),
(Wrapper(3), "c".to_string()),
(Wrapper(2), "d".to_string()),
],
};
let json = r#"{
"s": {
"1": "a",
"2": "b",
"3": "c",
"2": "d"
}
}"#;
assert_eq!(json, serde_json::to_string_pretty(&data).unwrap());
Trait Implementations§
source§impl<'de, K, KAs, V, VAs, const N: usize> DeserializeAs<'de, [(K, V); N]> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
impl<'de, K, KAs, V, VAs, const N: usize> DeserializeAs<'de, [(K, V); N]> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
source§fn deserialize_as<D>(deserializer: D) -> Result<[(K, V); N], D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<[(K, V); N], D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BTreeSet<(K, V)>> for Map<KAs, VAs>
impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BTreeSet<(K, V)>> for Map<KAs, VAs>
source§fn deserialize_as<D>(deserializer: D) -> Result<BTreeSet<(K, V)>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<BTreeSet<(K, V)>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BinaryHeap<(K, V)>> for Map<KAs, VAs>
impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BinaryHeap<(K, V)>> for Map<KAs, VAs>
source§fn deserialize_as<D>(deserializer: D) -> Result<BinaryHeap<(K, V)>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<BinaryHeap<(K, V)>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Box<[(K, V)]>> for Map<KAs, VAs>
impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Box<[(K, V)]>> for Map<KAs, VAs>
source§fn deserialize_as<D>(deserializer: D) -> Result<Box<[(K, V)]>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<Box<[(K, V)]>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, HashSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, HashSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
source§fn deserialize_as<D>(deserializer: D) -> Result<HashSet<(K, V), S>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<HashSet<(K, V), S>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, HashSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, HashSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
source§fn deserialize_as<D>(
deserializer: D,
) -> Result<HashbrownSet014<(K, V), S>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(
deserializer: D,
) -> Result<HashbrownSet014<(K, V), S>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, HashSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, HashSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
source§fn deserialize_as<D>(
deserializer: D,
) -> Result<HashbrownSet015<(K, V), S>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(
deserializer: D,
) -> Result<HashbrownSet015<(K, V), S>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, IndexSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, IndexSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
source§fn deserialize_as<D>(deserializer: D) -> Result<IndexSet<(K, V), S>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<IndexSet<(K, V), S>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, IndexSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
impl<'de, K, KAs, V, VAs, S> DeserializeAs<'de, IndexSet<(K, V), S>> for Map<KAs, VAs>where
KAs: DeserializeAs<'de, K>,
VAs: DeserializeAs<'de, V>,
(K, V): Eq + Hash,
S: BuildHasher + Default,
source§fn deserialize_as<D>(deserializer: D) -> Result<IndexSet2<(K, V), S>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<IndexSet2<(K, V), S>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs> DeserializeAs<'de, LinkedList<(K, V)>> for Map<KAs, VAs>
impl<'de, K, KAs, V, VAs> DeserializeAs<'de, LinkedList<(K, V)>> for Map<KAs, VAs>
source§fn deserialize_as<D>(deserializer: D) -> Result<LinkedList<(K, V)>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<LinkedList<(K, V)>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Vec<(K, V)>> for Map<KAs, VAs>
impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Vec<(K, V)>> for Map<KAs, VAs>
source§fn deserialize_as<D>(deserializer: D) -> Result<Vec<(K, V)>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<Vec<(K, V)>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<'de, K, KAs, V, VAs> DeserializeAs<'de, VecDeque<(K, V)>> for Map<KAs, VAs>
impl<'de, K, KAs, V, VAs> DeserializeAs<'de, VecDeque<(K, V)>> for Map<KAs, VAs>
source§fn deserialize_as<D>(deserializer: D) -> Result<VecDeque<(K, V)>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<VecDeque<(K, V)>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<K, V, KA, VA> JsonSchemaAs<[(K, V)]> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, KA, VA> JsonSchemaAs<[(K, V)]> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, V, KA, VA, const N: usize> JsonSchemaAs<[(K, V); N]> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, KA, VA, const N: usize> JsonSchemaAs<[(K, V); N]> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, V, KA, VA> JsonSchemaAs<BTreeSet<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, KA, VA> JsonSchemaAs<BTreeSet<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, V, KA, VA> JsonSchemaAs<BinaryHeap<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, KA, VA> JsonSchemaAs<BinaryHeap<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, V, KA, VA> JsonSchemaAs<Box<[(K, V)]>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, KA, VA> JsonSchemaAs<Box<[(K, V)]>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, V, S, KA, VA> JsonSchemaAs<HashSet<(K, V), S>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, S, KA, VA> JsonSchemaAs<HashSet<(K, V), S>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, V, KA, VA> JsonSchemaAs<LinkedList<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, KA, VA> JsonSchemaAs<LinkedList<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, V, KA, VA> JsonSchemaAs<Vec<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, KA, VA> JsonSchemaAs<Vec<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, V, KA, VA> JsonSchemaAs<VecDeque<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature schemars_0_8
only.
impl<K, V, KA, VA> JsonSchemaAs<VecDeque<(K, V)>> for Map<KA, VA>where
VA: JsonSchemaAs<V>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<K, KAs, V, VAs> SerializeAs<[(K, V)]> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs> SerializeAs<[(K, V)]> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(source: &[(K, V)], serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(source: &[(K, V)], serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs, const N: usize> SerializeAs<[(K, V); N]> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs, const N: usize> SerializeAs<[(K, V); N]> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(
source: &[(K, V); N],
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &[(K, V); N],
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs> SerializeAs<BTreeSet<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs> SerializeAs<BTreeSet<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(
source: &BTreeSet<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &BTreeSet<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs> SerializeAs<BinaryHeap<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs> SerializeAs<BinaryHeap<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(
source: &BinaryHeap<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &BinaryHeap<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs> SerializeAs<Box<[(K, V)]>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs> SerializeAs<Box<[(K, V)]>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(
source: &Box<[(K, V)]>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &Box<[(K, V)]>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs, H> SerializeAs<HashSet<(K, V), H>> for Map<KAs, VAs>
impl<K, KAs, V, VAs, H> SerializeAs<HashSet<(K, V), H>> for Map<KAs, VAs>
source§fn serialize_as<S>(
source: &HashSet<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &HashSet<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs, H> SerializeAs<HashSet<(K, V), H>> for Map<KAs, VAs>
impl<K, KAs, V, VAs, H> SerializeAs<HashSet<(K, V), H>> for Map<KAs, VAs>
source§fn serialize_as<S>(
source: &HashbrownSet014<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &HashbrownSet014<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs, H> SerializeAs<HashSet<(K, V), H>> for Map<KAs, VAs>
impl<K, KAs, V, VAs, H> SerializeAs<HashSet<(K, V), H>> for Map<KAs, VAs>
source§fn serialize_as<S>(
source: &HashbrownSet015<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &HashbrownSet015<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs, H> SerializeAs<IndexSet<(K, V), H>> for Map<KAs, VAs>
impl<K, KAs, V, VAs, H> SerializeAs<IndexSet<(K, V), H>> for Map<KAs, VAs>
source§fn serialize_as<S>(
source: &IndexSet<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &IndexSet<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs, H> SerializeAs<IndexSet<(K, V), H>> for Map<KAs, VAs>
impl<K, KAs, V, VAs, H> SerializeAs<IndexSet<(K, V), H>> for Map<KAs, VAs>
source§fn serialize_as<S>(
source: &IndexSet2<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &IndexSet2<(K, V), H>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs> SerializeAs<LinkedList<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs> SerializeAs<LinkedList<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(
source: &LinkedList<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &LinkedList<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs> SerializeAs<Option<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs> SerializeAs<Option<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(
source: &Option<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &Option<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs> SerializeAs<Vec<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs> SerializeAs<Vec<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(
source: &Vec<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &Vec<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
source§impl<K, KAs, V, VAs> SerializeAs<VecDeque<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
impl<K, KAs, V, VAs> SerializeAs<VecDeque<(K, V)>> for Map<KAs, VAs>where
KAs: SerializeAs<K>,
VAs: SerializeAs<V>,
source§fn serialize_as<S>(
source: &VecDeque<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &VecDeque<(K, V)>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
Auto Trait Implementations§
impl<K, V> Freeze for Map<K, V>
impl<K, V> RefUnwindSafe for Map<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Map<K, V>
impl<K, V> Sync for Map<K, V>
impl<K, V> Unpin for Map<K, V>
impl<K, V> UnwindSafe for Map<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more