Skip to main content

Provenance

Enum Provenance 

Source
pub enum Provenance {
    Primitive {
        op: OpId,
        role: Role,
    },
    Derived {
        op: OpId,
        from: SmallVec<[EntityId; 2]>,
        role: Role,
    },
    Imported {
        source: SourceId,
        external: u64,
    },
}
Expand description

Where an entity came from.

Variants§

§

Primitive

Created outright by an operation, from no prior entity: the +Z face of a box, the lateral surface of a cylinder.

Fields

§op: OpId

The operation that created it.

§role: Role

Which part of that operation’s result this is.

§

Derived

Derived from one or more existing entities. A face split by a boolean names the face it came from; an intersection edge names both faces.

Fields

§op: OpId

The operation that derived it.

§from: SmallVec<[EntityId; 2]>

The inputs it came from, in the operation’s canonical order.

§role: Role

Which part of that operation’s result this is.

§

Imported

Read from a file. external is the source’s own identifier (a STEP entity number, say) so that a re-import matches entities up.

Fields

§source: SourceId

Which imported document it came from.

§external: u64

The identifier the source file gave it.

Implementations§

Source§

impl Provenance

Source

pub const fn op(&self) -> Option<OpId>

The operation that produced this entity, if any.

Source

pub const fn role(&self) -> Option<Role>

Which part of its operation’s result this entity is, if the operation named one.

The question provenance exists to answer: “the top face of that box”, asked of a model that has been rebuilt since. An imported entity has no role, because the file said where it came from and not what it is for.

Source

pub fn inputs(&self) -> &[EntityId]

The entities this one was derived from.

Trait Implementations§

Source§

impl Clone for Provenance

Source§

fn clone(&self) -> Provenance

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Provenance

Source§

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

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

impl Eq for Provenance

Source§

impl PartialEq for Provenance

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Provenance

Auto Trait Implementations§

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.