Closed NivN closed 1 year ago
Documented in the introductory text for SearchEntry
:
Since it’s possible that a particular set of values for a binary attribute could be converted into UTF-8
String
s, the presence of such attribute in the result entry should be checked for both inattrs
andbin_atrrs
.
Short of consulting the schema for every converted attribute, there is no way to tell in advance if an attribute is binary. (Not even schema checking will be foolproof.) So all this works as intended.
In the construction of a SearchEntry, attributes are seperated to attrs and bin_attrs hashmap. The code expects std::str::from_utf8 to fail for a binary attribute (search.rs:195), but it may succeed for some binary data. Because of this it is impossible to determine if a binary attribute will appear in attrs or bin attrs since it is affected by the content of the data rather than by the data type.