Node

Enum Node 

Source
pub enum Node {
    Element {
        ifc_type: String,
        components: Vec<Component>,
    },
    Set {
        kind: SetKind,
        name: String,
        members: Vec<Field>,
    },
    Relationship {
        ifc_type: String,
        roles: Vec<Role>,
    },
    Geometry {
        tier: String,
        digest: String,
    },
    NameBag {
        kind: String,
        names: Vec<String>,
    },
}
Expand description

A node, before it is addressed.

Variants§

§

Element

A fold of component addresses. Carries no key — see the module docs.

Fields

§ifc_type: String

Exact IFC EXPRESS PascalCase class, e.g. IfcWallStandardCase.

§components: Vec<Component>
§

Set

A named set of scalar members.

Fields

§kind: SetKind
§name: String
§members: Vec<Field>
§

Relationship

A relationship: a class and its roles, each role a set of targets.

Targets are node addresses, which keeps the node content-only and is also where this encoding drops information the source records: two coincident duplicates have distinct GlobalIds and the source relationship names one of them, but they share one address, so a relationship naming either names both. Whether such duplicates are one node or must be separated — and by what, if not a GlobalId — is the spec set’s open equivalence policy (02-graph-object-model.md §2.8); node-address endpoints are the current proposal, not a decision. A forthcoming dedup-boundary integration suite on #8262 measures this.

Fields

§ifc_type: String
§roles: Vec<Role>
§

Geometry

Geometry for one tier, addressed by the digest the geometry pass already produces rather than re-hashed here.

Fields

§tier: String
§digest: String
§

NameBag

A bag of resolved names: materials, classification references.

Fields

§kind: String
§names: Vec<String>

Implementations§

Source§

impl Node

Source

pub fn kind(&self) -> NodeKind

The kind tag written into the header.

Source

pub fn encode(&self) -> (Address, Vec<u8>)

Canonical bytes and the resulting address.

Sets are sorted; lists whose order is content are not. Sorting is by NFC-normalized UTF-8 bytes (see sort_key) — the same bytes the encoder writes — so neither input order nor the producer’s choice of Unicode spelling can reach the hash.

Source

pub fn address(&self) -> Address

The node’s content address.

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Node

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Node

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Node

Source§

fn eq(&self, other: &Node) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.