#[non_exhaustive]pub enum Dimension {
Stated {
value: f64,
},
Automatic {
cached: Option<f64>,
},
}Expand description
A number a .ork writes, which OpenRocket may be working out for itself.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Stated
A number the designer typed.
Automatic
A number OpenRocket works out from the neighbouring components.
Implementations§
Source§impl Dimension
impl Dimension
Sourcepub fn value(self) -> Option<f64>
pub fn value(self) -> Option<f64>
The number, whether it was typed or cached. None for a bare auto.
Sourcepub fn is_automatic(self) -> bool
pub fn is_automatic(self) -> bool
Whether OpenRocket works this dimension out for itself.
Sourcepub fn parse(text: &str) -> Option<Self>
pub fn parse(text: &str) -> Option<Self>
Reads a dimension from an element’s text, or None when the text is neither a finite
number nor auto.
Only a tag that holds a dimension should be read this way. <ignitionevent>automatic </ignitionevent> is a word, not a number, and gives None rather than an automatic
dimension.
Trait Implementations§
impl Copy for Dimension
Source§impl<'de> Deserialize<'de> for Dimension
impl<'de> Deserialize<'de> for Dimension
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 Dimension
impl JsonSchema for Dimension
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 Dimension
Auto Trait Implementations§
impl Freeze for Dimension
impl RefUnwindSafe for Dimension
impl Send for Dimension
impl Sync for Dimension
impl Unpin for Dimension
impl UnsafeUnpin for Dimension
impl UnwindSafe for Dimension
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