Trait Attributes

Source
pub trait Attributes {
    // Required method
    fn raw_attribute(&self, id: &str) -> Option<&Value>;

    // Provided method
    fn attribute(&self, id: &str) -> Option<&Value> { ... }
}
Expand description

A node’s attributes keyed by namespaced attribute id, as in a file’s schemas (for example points::array or gltf::material).

Values are the attribute values as written, not the flattened <id>::<component> keys the upstream viewer builds. A JSON null counts as absent, because in IFCX it deletes an attribute when layers merge.

Implemented for a single [IfcxNode], a [FlatNode] from [openbim_ifcx::flatten()], a [ComposedNode] from [openbim_ifcx::compose()], plain attribute maps, and references to them.

Required Methods§

Source

fn raw_attribute(&self, id: &str) -> Option<&Value>

The raw value of attribute id, or None when absent.

Provided Methods§

Source

fn attribute(&self, id: &str) -> Option<&Value>

The value of attribute id, or None when absent or null.

Implementations on Foreign Types§

Source§

impl Attributes for Map<String, Value>

Source§

fn raw_attribute(&self, id: &str) -> Option<&Value>

Source§

impl Attributes for ComposedNode

Source§

fn raw_attribute(&self, id: &str) -> Option<&Value>

Source§

impl Attributes for FlatNode

Source§

fn raw_attribute(&self, id: &str) -> Option<&Value>

Source§

impl Attributes for IfcxNode

Source§

fn raw_attribute(&self, id: &str) -> Option<&Value>

Source§

impl Attributes for IndexMap<String, Value>

Source§

fn raw_attribute(&self, id: &str) -> Option<&Value>

Source§

impl<T: Attributes + ?Sized> Attributes for &T

Source§

fn raw_attribute(&self, id: &str) -> Option<&Value>

Implementors§