Add docstrings for Schema methods.

This commit is contained in:
Richard Newman 2017-02-13 19:39:47 -08:00
parent a87e5a3ec7
commit bfb62302cb

View file

@ -224,10 +224,12 @@ impl Schema {
self.schema_map.get(&x)
}
/// Return true if the provided entid identifies an attribute in this schema.
pub fn is_attribute(&self, x: Entid) -> bool {
self.schema_map.contains_key(&x)
}
/// Return true if the provided ident identifies an attribute in this schema.
pub fn identifies_attribute(&self, x: &String) -> bool {
self.get_entid(x).map(|e| self.is_attribute(e)).unwrap_or(false)
}