ifc-cost
Cost semantics as a borrowed view over the IFC model.
| Status | Implemented |
| Latest release | 0.3.0 (2026-09-29) |
| Registries | crates.io ifc-cost |
| Via the facade | openbim-ifc feature cost |
| API documentation | rustdoc · docs.rs |
| Source | crates/ifc-cost/ |
Overview
ifc-cost — cost semantics as a view over the model.
Depends on
Changes
Latest release, 0.3.0 (2026-09-29):
Added
- IFC2X3 cost schedules can carry their dates (#214):
DateTimeValuecarries a date either as IFC4/IFC4X3IfcDateTimetext (DateTimeValue::Text,From<&str>) or as one of the IFC2X3IfcDateTimeSelectrecords (Date(CalendarDate),Time(LocalTime),DateAndTime(CalendarDate, LocalTime)). In IFC2X3create_cost_schedule_with_owner_historystages theIfcCalendarDate,IfcLocalTimeandIfcDateAndTimerecords forSubmittedOnandUpdateDateand references them, only once the schedule itself is accepted. Record forms are checked against the schema's rules before anything is staged (IfcValidCalendarDatewithIfcLeapYear,IfcValidTime, and the component ranges), refused withInvalidValue. The types duplicateifc-schedule's, since sibling domain crates may not depend on each other. - Every draft has a constructor and a setter per optional field, named after it:
CostItemDraft::new(global_id),CostScheduleDraft::new(global_id),NestingDraft::new(global_id, parent, children),ScheduleAssignmentDraft::new(global_id, schedule, items),QuantityDraft::new(kind, name, value);CostValueDraftkeepsmonetaryandDefaultand gains setters.
Fixed
create_cost_schedule_with_owner_historyno longer refuses every dated IFC2X3 schedule (#214): a record form is written as theIfcDateTimeSelectIFC2X3 declares. In IFC4 and IFC4X3 a record form is refused withAuthoringValueType, as text is in IFC2X3.
Changed (breaking)
create_cost_value,create_monetary_unitandcreate_currency_relationshipbind the model's declared release and lay their records out by attribute name (#213). They wrote the IFC4 layout into every model. In IFC2X3 anIfcCostValuehas eight attributes and requiresCostType, written fromcategory(IFC4 renamedCostTypetoCategory); a composed value (ArithmeticOperator,Components) is refused withAuthoringNotInSchema.IfcMonetaryUnit.Currencyis anIfcCurrencyEnumenumerator in IFC2X3 (a label it does not list isAuthoringValueType) and anIfcLabelfrom IFC4 on. An IFC2X3IfcCurrencyRelationshiphas five attributes and requiresRateDateTimeas anIfcDateAndTimerecord. IFC4 and IFC4X3 records are unchanged.create_monetary_unittakes the&Model(create_monetary_unit(tx, model, currency)), which it needs to bind the release.CostValueDraft::applicable_dateandfixed_until_dateareOption<DateTimeValue>, andcreate_currency_relationshiptakesrate_date_time: Option<DateTimeValue>: IFC4 and IFC4X3 text as before ("2026-01-01".into(); the draft setters takeimpl Into<DateTimeValue>), or an IFC2X3 record form, which the writer stages. A form the release does not declare is refused withAuthoringValueType.CostView::schedulesreturnsResult<impl Iterator<Item = CostSchedule>, CostError>and everyCostScheduleaccessor reads its attribute by name in the model's declared release (#212). The IFC4 positions misread an IFC2X3IfcCostSchedule:PreparedByas the predefined type, theSubmittedOnrecord as the status andSubmittedByas the identification.identificationreads IFC2X3'sID, which IFC4 renamed. A header declaring IFC4X1, IFC4X2 or an unknown release isCostError::UnsupportedSchema, severalCostError::MultipleSchemas(new variants); no header reads as IFC4.CostSchedule::submitted_onandupdate_datereturnOption<AuthoredDateTime>: IFC4/IFC4X3 text or the IFC2X3 date record (AuthoredDateTime::Record), neverNonefor a stated IFC2X3 date.CostSchedule::new(id, entity, release)takes the release to read against and returnsResult, refusing IFC4X1 and IFC4X2.CostValueDraft,CostItemDraft,CostScheduleDraft,NestingDraft,ScheduleAssignmentDraftandQuantityDraftare#[non_exhaustive]: build them with their constructors and setters instead of a struct literal. Their fields stay public to read and assign.CostScheduleDraft::submitted_onandupdate_dateareOption<DateTimeValue<'a>>(wereOption<&'a str>); text converts with.into()or through the setters, and IFC4/IFC4X3 output is unchanged.#[non_exhaustive]on the public enums and result structs a later release could extend:CostItemType,CostScheduleType,CostValueKind,QuantityKind,ArithmeticOperator,UnitBasisandConsistency. Amatchoutside the crate needs a wildcard arm, and the structs can no longer be built outside it.
Changed
- Depends on
ifc-schemawith its default features named explicitly (every bundled release), now that the workspace dependency turns them off for the facade's per-release features (#112). - A model whose header declares
IFC4X1orIFC4X2is refused with the existing unsupported-schema error.ifc-schemanow bundles both releases, but no layout here is verified against them, so they are never read as IFC4 or IFC4X3.
Full history: crates/ifc-cost/CHANGELOG.md