Skip to main content

OccurrenceDraft

Struct OccurrenceDraft 

Source
#[non_exhaustive]
pub struct OccurrenceDraft<'a> { pub name: Option<&'a str>, pub description: Option<&'a str>, pub object_type: Option<&'a str>, pub placement: Option<EntityId>, pub representation: Option<EntityId>, pub tag: Option<&'a str>, pub shape_type: Option<&'a str>, pub nominal_diameter: Option<f64>, pub cross_section_area: Option<f64>, pub bar_role: Option<&'a str>, pub longitudinal_bars: Option<MeshBars>, pub transverse_bars: Option<MeshBars>, }
Expand description

Attributes of an occurrence: those every class shares, and the few that one class requires on top.

The struct is #[non_exhaustive]: build it with OccurrenceDraft::new and the setters, so a field a later release needs can be added without breaking callers.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: Option<&'a str>

Name.

§description: Option<&'a str>

Description.

§object_type: Option<&'a str>

ObjectType; required when PredefinedType is USERDEFINED.

§placement: Option<EntityId>

ObjectPlacement.

§representation: Option<EntityId>

Representation.

§tag: Option<&'a str>

Tag, slot 7 on every class in this catalogue.

§shape_type: Option<&'a str>

ShapeType of an IFC2X3 IfcRamp, IfcRoof or IfcStair, a token of that release’s enumeration; required there.

§nominal_diameter: Option<f64>

NominalDiameter of an IfcReinforcingBar or IfcTendon, an IfcPositiveLengthMeasure; required in IFC2X3.

§cross_section_area: Option<f64>

CrossSectionArea of an IfcReinforcingBar or IfcTendon, an IfcAreaMeasure; required in IFC2X3.

§bar_role: Option<&'a str>

BarRole of an IFC2X3 IfcReinforcingBar, an IfcReinforcingBarRoleEnum token; required there.

§longitudinal_bars: Option<MeshBars>

The longitudinal bars of an IfcReinforcingMesh; required in IFC2X3.

§transverse_bars: Option<MeshBars>

The transverse bars of an IfcReinforcingMesh; required in IFC2X3.

Implementations§

Source§

impl<'a> OccurrenceDraft<'a>

Source

pub fn new() -> Self

Starts an empty draft with every attribute unset.

Source

pub fn name(self, value: &'a str) -> Self

Sets Name.

Source

pub fn description(self, value: &'a str) -> Self

Sets Description.

Source

pub fn object_type(self, value: &'a str) -> Self

Sets ObjectType.

Source

pub fn placement(self, value: EntityId) -> Self

Sets ObjectPlacement.

Source

pub fn representation(self, value: EntityId) -> Self

Sets Representation.

Source

pub fn tag(self, value: &'a str) -> Self

Sets Tag.

Source

pub fn shape_type(self, value: &'a str) -> Self

Sets the IFC2X3 ShapeType.

Source

pub fn nominal_diameter(self, value: f64) -> Self

Sets NominalDiameter.

Source

pub fn cross_section_area(self, value: f64) -> Self

Sets CrossSectionArea.

Source

pub fn bar_role(self, value: &'a str) -> Self

Sets the IFC2X3 BarRole.

Source

pub fn longitudinal_bars(self, value: MeshBars) -> Self

Sets the longitudinal bars of a mesh.

Source

pub fn transverse_bars(self, value: MeshBars) -> Self

Sets the transverse bars of a mesh.

Trait Implementations§

Source§

impl<'a> Clone for OccurrenceDraft<'a>

Source§

fn clone(&self) -> OccurrenceDraft<'a>

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<'a> Copy for OccurrenceDraft<'a>

Source§

impl<'a> Debug for OccurrenceDraft<'a>

Source§

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

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

impl<'a> Default for OccurrenceDraft<'a>

Source§

fn default() -> OccurrenceDraft<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for OccurrenceDraft<'a>

§

impl<'a> RefUnwindSafe for OccurrenceDraft<'a>

§

impl<'a> Send for OccurrenceDraft<'a>

§

impl<'a> Sync for OccurrenceDraft<'a>

§

impl<'a> Unpin for OccurrenceDraft<'a>

§

impl<'a> UnsafeUnpin for OccurrenceDraft<'a>

§

impl<'a> UnwindSafe for OccurrenceDraft<'a>

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
§

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

§

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.

§

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