pub struct CopyOnWriteMutation {
pub express_id: u32,
pub index: usize,
pub value: String,
pub referrer_id: u32,
pub referrer_index: usize,
}Expand description
Replace one attribute of a record that other records share, by copying the record and repointing a single referrer at the copy.
The reason this is a writer job rather than a caller one is the id. A copy
needs a number no record holds, and the writer is what knows max_id; a
caller that allocates its own has to agree with PropMutation’s synthesis
about which numbers are free, and two allocators sharing one space is a
collision waiting for the first export that uses both.
Doing it here also keeps the copy inside the emit path, so it is counted in
StepStats::written and converted when the export targets another schema.
A record spliced into the output afterwards is neither.
Property sets are the case this exists for. IFC exporters routinely give
each element its own IfcPropertySet and point them all at one
IfcPropertySingleValue per distinct value, so editing that value in place
changes it for every element sharing it. Copying first changes one.
Fields§
§express_id: u32The record to copy.
index: usizeWhich attribute of the copy to replace, zero-based.
value: StringThe replacement, STEP-serialized, e.g. IFCLABEL('2HR').
referrer_id: u32The record that should point at the copy instead of the original.
referrer_index: usizeWhich attribute of the referrer holds that reference. A list attribute is rewritten with the one reference substituted and the rest untouched.
Trait Implementations§
Source§impl Clone for CopyOnWriteMutation
impl Clone for CopyOnWriteMutation
Source§fn clone(&self) -> CopyOnWriteMutation
fn clone(&self) -> CopyOnWriteMutation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CopyOnWriteMutation
impl Debug for CopyOnWriteMutation
Source§impl PartialEq for CopyOnWriteMutation
impl PartialEq for CopyOnWriteMutation
impl Eq for CopyOnWriteMutation
impl StructuralPartialEq for CopyOnWriteMutation
Auto Trait Implementations§
impl Freeze for CopyOnWriteMutation
impl RefUnwindSafe for CopyOnWriteMutation
impl Send for CopyOnWriteMutation
impl Sync for CopyOnWriteMutation
impl Unpin for CopyOnWriteMutation
impl UnwindSafe for CopyOnWriteMutation
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.