pub struct GlobalId(/* private fields */);Expand description
A stable, IFC-compatible element identity.
Implementations§
Source§impl GlobalId
impl GlobalId
Sourcepub fn from_bytes(bytes: [u8; 16]) -> Self
pub fn from_bytes(bytes: [u8; 16]) -> Self
Build from raw bytes.
Used to derive deterministic identities — an exporter that mints a random GlobalId for each synthesised entity produces a different file every run, which defeats content-addressed revisions and golden-file tests.
Sourcepub fn parse(s: &str) -> Result<Self, GlobalIdError>
pub fn parse(s: &str) -> Result<Self, GlobalIdError>
Accept an identity that came from a file, validating it rather than trusting it.
Imported IFC is untrusted input (docs/ifc-semantics.md §13).
Sourcepub fn to_uuid(&self) -> Uuid
pub fn to_uuid(&self) -> Uuid
Expand back to a UUID. Round-trips with GlobalId::from_uuid.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GlobalId
impl<'de> Deserialize<'de> for GlobalId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GlobalId
Source§impl Ord for GlobalId
impl Ord for GlobalId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for GlobalId
impl PartialOrd for GlobalId
impl StructuralPartialEq for GlobalId
Auto Trait Implementations§
impl Freeze for GlobalId
impl RefUnwindSafe for GlobalId
impl Send for GlobalId
impl Sync for GlobalId
impl Unpin for GlobalId
impl UnsafeUnpin for GlobalId
impl UnwindSafe for GlobalId
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