pub struct Dimension { /* private fields */ }Expand description
SI-style dimension vector. Angle is tracked separately from the seven SI base dimensions so trigonometric functions can require angle/dimensionless inputs explicitly.
Implementations§
Source§impl Dimension
impl Dimension
pub const DIMENSIONLESS: Dimension
pub const ANGLE: Dimension
pub fn new(exponents: [i8; 8]) -> Dimension
pub fn exponents(&self) -> [i8; 8]
pub fn get(&self, index: usize) -> i8
pub fn is_dimensionless(&self) -> bool
pub fn is_angle(&self) -> bool
pub fn is_angle_only(&self) -> bool
pub fn multiply(&self, other: &Dimension) -> Result<Dimension, EngineError>
pub fn divide(&self, other: &Dimension) -> Result<Dimension, EngineError>
pub fn pow(&self, exponent: i32) -> Result<Dimension, EngineError>
pub fn to_json(&self) -> Value
pub fn from_json(value: &Value) -> Result<Dimension, EngineError>
Trait Implementations§
impl Copy for Dimension
Source§impl<'de> Deserialize<'de> for Dimension
impl<'de> Deserialize<'de> for Dimension
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Dimension
impl 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