MCPcopy Create free account
hub / github.com/cosdata/cosdata / comparable_encoding

Method comparable_encoding

src/metadata/schema.rs:34–42  ·  view source on GitHub ↗

Returns a tuple that can be used to compare instances of this struct. This is done because this struct uses HashSet, so it can't derive from the Hash trait. The use case for comparing `SupportedCondition` instances is rare, so `BTreeSet` seems to be an overkill.

(&self)

Source from the content-addressed store, hash-verified

32 /// `SupportedCondition` instances is rare, so `BTreeSet` seems to
33 /// be an overkill.
34 fn comparable_encoding(&self) -> (&str, Vec<&str>) {
35 let mut field_names = self.field_names().into_iter().collect::<Vec<&str>>();
36 field_names.sort();
37 let kind = match self {
38 Self::And(_) => "and",
39 Self::Or(_) => "or",
40 };
41 (kind, field_names)
42 }
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]

Callers 1

newMethod · 0.80

Calls 1

field_namesMethod · 0.80

Tested by

no test coverage detected