allows to get names from schema

This commit is contained in:
mposmta 2020-04-06 20:05:31 +02:00 committed by marin
parent 3e031d8297
commit c3d5778aae

View File

@ -79,6 +79,10 @@ impl Schema {
self.fields_map.name(id) self.fields_map.name(id)
} }
pub fn names(&self) -> impl Iterator<Item = &str> {
self.fields_map.iter().map(|(k, _)| k.as_ref())
}
pub fn contains(&self, name: &str) -> bool { pub fn contains(&self, name: &str) -> bool {
self.fields_map.id(name).is_some() self.fields_map.id(name).is_some()
} }