pub struct ElementRef {
pub document: Option<String>,
pub id: String,
}Expand description
A reference to one element, optionally inside a named document.
Cross-document referencing is the shared shape behind BCF viewpoint components and ICDD linkset endpoints. Both name a document and an element within it; only the vocabulary differs.
Fields§
§document: Option<String>The document the element lives in, when the reference crosses one.
None means “the current document” — an intra-document reference.
id: StringThe element’s identifier within that document, verbatim.
Kept as an opaque string on purpose: an IFC GlobalId, an ICDD URI and
a BCF component GUID are not the same syntax, and normalising them here
would lose information that only the owning standard can interpret.
Implementations§
Source§impl ElementRef
impl ElementRef
Sourcepub fn in_document(document: impl Into<String>, id: impl Into<String>) -> Self
pub fn in_document(document: impl Into<String>, id: impl Into<String>) -> Self
A reference into another document.
Sourcepub fn is_cross_document(&self) -> bool
pub fn is_cross_document(&self) -> bool
Whether this reference crosses a document boundary.
Trait Implementations§
Source§impl Clone for ElementRef
impl Clone for ElementRef
Source§fn clone(&self) -> ElementRef
fn clone(&self) -> ElementRef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElementRef
impl Debug for ElementRef
impl Eq for ElementRef
Source§impl Hash for ElementRef
impl Hash for ElementRef
Source§impl PartialEq for ElementRef
impl PartialEq for ElementRef
impl StructuralPartialEq for ElementRef
Auto Trait Implementations§
impl Freeze for ElementRef
impl RefUnwindSafe for ElementRef
impl Send for ElementRef
impl Sync for ElementRef
impl Unpin for ElementRef
impl UnsafeUnpin for ElementRef
impl UnwindSafe for ElementRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more