pub struct BomComponent {
pub component_material_id: String,
pub quantity: Decimal,
pub uom: String,
pub scrap_percentage: Decimal,
pub is_optional: bool,
pub position: u16,
}Expand description
Component in a bill of materials.
Fields§
§component_material_id: StringComponent material ID
quantity: DecimalQuantity required per parent unit
uom: StringUnit of measure
scrap_percentage: DecimalScrap percentage (waste factor)
is_optional: boolIs this component optional?
position: u16Position/sequence in BOM
Implementations§
Source§impl BomComponent
impl BomComponent
Sourcepub fn new(
component_material_id: impl Into<String>,
quantity: Decimal,
uom: impl Into<String>,
) -> Self
pub fn new( component_material_id: impl Into<String>, quantity: Decimal, uom: impl Into<String>, ) -> Self
Create a new BOM component.
Sourcepub fn with_scrap(self, scrap_percentage: Decimal) -> Self
pub fn with_scrap(self, scrap_percentage: Decimal) -> Self
Set scrap percentage.
Sourcepub fn effective_quantity(&self) -> Decimal
pub fn effective_quantity(&self) -> Decimal
Calculate effective quantity including scrap.
Trait Implementations§
Source§impl Clone for BomComponent
impl Clone for BomComponent
Source§fn clone(&self) -> BomComponent
fn clone(&self) -> BomComponent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BomComponent
impl Debug for BomComponent
Source§impl<'de> Deserialize<'de> for BomComponent
impl<'de> Deserialize<'de> for BomComponent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BomComponent
impl RefUnwindSafe for BomComponent
impl Send for BomComponent
impl Sync for BomComponent
impl Unpin for BomComponent
impl UnwindSafe for BomComponent
Blanket Implementations§
Source§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
Mutably borrows from an owned value. Read more