pub struct MaterialSpec {
pub name: Option<String>,
pub density_g_cm3: Option<f64>,
pub elements: Vec<ElementSpec>,
}Expand description
Serialized form of a Material (what the CLI’s TOML describes).
Fields§
§name: Option<String>Display name.
density_g_cm3: Option<f64>Mass density override, g/cm³. Required for compounds.
elements: Vec<ElementSpec>Elements, in order.
Trait Implementations§
Source§impl Clone for MaterialSpec
impl Clone for MaterialSpec
Source§fn clone(&self) -> MaterialSpec
fn clone(&self) -> MaterialSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MaterialSpec
impl Debug for MaterialSpec
Source§impl Default for MaterialSpec
impl Default for MaterialSpec
Source§fn default() -> MaterialSpec
fn default() -> MaterialSpec
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MaterialSpec
impl<'de> Deserialize<'de> for MaterialSpec
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 From<Material> for MaterialSpec
impl From<Material> for MaterialSpec
Source§impl PartialEq for MaterialSpec
impl PartialEq for MaterialSpec
Source§impl Serialize for MaterialSpec
impl Serialize for MaterialSpec
impl StructuralPartialEq for MaterialSpec
Source§impl TryFrom<MaterialSpec> for Material
impl TryFrom<MaterialSpec> for Material
Source§type Error = MaterialError
type Error = MaterialError
The type returned in the event of a conversion error.
Source§fn try_from(spec: MaterialSpec) -> Result<Self, MaterialError>
fn try_from(spec: MaterialSpec) -> Result<Self, MaterialError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for MaterialSpec
impl RefUnwindSafe for MaterialSpec
impl Send for MaterialSpec
impl Sync for MaterialSpec
impl Unpin for MaterialSpec
impl UnsafeUnpin for MaterialSpec
impl UnwindSafe for MaterialSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more