Skip to main content

CostValue

Struct CostValue 

Source
pub struct CostValue<'m> { /* private fields */ }
Expand description

A borrowed view of an IfcCostValue entity.

Implementations§

Source§

impl<'m> CostValue<'m>

Source

pub fn new(id: EntityId, entity: &'m Entity) -> Self

Wrap an entity known to be an IfcCostValue.

Source

pub fn id(&self) -> EntityId

The entity id in the file.

Source

pub fn name(&self) -> Option<&'m str>

The value’s name, e.g. Estimate.

Source

pub fn description(&self) -> Option<&'m str>

The value’s description.

Source

pub fn amount(&self) -> Option<f64>

The directly stated amount.

None for a composed value that states only Components. Use CostValue::component_refs and CostValue::operator for those, or CostValue::is_composed to tell the two shapes apart.

Source

pub fn measure(&self) -> Option<&'m str>

The measure type wrapping the applied value, e.g. IFCMONETARYMEASURE.

A cost value is not required to be monetary: IfcAppliedValueSelect also admits ratios and plain measures. Reporting the wrapper lets a caller refuse to add a ratio to a currency.

Source

pub fn is_monetary(&self) -> bool

Whether the applied value is a monetary measure.

Source

pub fn category(&self) -> Option<&'m str>

The rate category, e.g. Labour or Material.

Source

pub fn condition(&self) -> Option<&'m str>

The condition under which the value applies.

Source

pub fn applicable_date(&self) -> Option<&'m str>

The date from which the value applies, as authored.

Source

pub fn fixed_until_date(&self) -> Option<&'m str>

The date after which the value no longer holds, as authored.

Source

pub fn operator(&self) -> Option<ArithmeticOperator>

How this value’s components combine, if stated.

Source

pub fn component_refs(&self) -> Vec<EntityId>

Ids of the nested IfcAppliedValue components, in file order.

Order is preserved because it is the only ordering information the file carries, and an order-sensitive operator needs it.

Source

pub fn is_composed(&self) -> bool

Whether this value is composed from components rather than stated.

Source

pub fn unit_basis(&self, model: &Model) -> Option<UnitBasis>

The rate basis, if this value is a rate rather than a lump sum.

Resolves the IfcMeasureWithUnit: slot 0 is ValueComponent, slot 1 is UnitComponent.

Trait Implementations§

Source§

impl<'m> Clone for CostValue<'m>

Source§

fn clone(&self) -> Self

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<'m> Copy for CostValue<'m>

Source§

impl<'m> Debug for CostValue<'m>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'m> Freeze for CostValue<'m>

§

impl<'m> RefUnwindSafe for CostValue<'m>

§

impl<'m> Send for CostValue<'m>

§

impl<'m> Sync for CostValue<'m>

§

impl<'m> Unpin for CostValue<'m>

§

impl<'m> UnsafeUnpin for CostValue<'m>

§

impl<'m> UnwindSafe for CostValue<'m>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.