pub struct Material {
pub name: String,
pub density: Density,
}Expand description
A named material.
Fields§
§name: StringName, for display and for matching imported designs.
density: DensityDensity.
Implementations§
Source§impl Material
impl Material
Sourcepub fn bulk_kg_m3(&self, part: &'static str) -> Result<f64, DesignError>
pub fn bulk_kg_m3(&self, part: &'static str) -> Result<f64, DesignError>
The bulk density for part, kg/m³.
§Errors
DesignError::MaterialKind if the material isn’t bulk, DesignError::Domain if its
density is negative or not finite.
Sourcepub fn surface_kg_m2(&self, part: &'static str) -> Result<f64, DesignError>
pub fn surface_kg_m2(&self, part: &'static str) -> Result<f64, DesignError>
The surface density for part, kg/m²; errors as Material::bulk_kg_m3.
§Errors
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Material
impl<'de> Deserialize<'de> for Material
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
Source§impl JsonSchema for Material
impl JsonSchema for Material
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Material
Auto Trait Implementations§
impl Freeze for Material
impl RefUnwindSafe for Material
impl Send for Material
impl Sync for Material
impl Unpin for Material
impl UnsafeUnpin for Material
impl UnwindSafe for Material
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