pub struct OrbitalElementValue { /* private fields */ }Implementations§
Source§impl OrbitalElementValue
impl OrbitalElementValue
Sourcepub const fn new(value: f64) -> Result<Self, OrbitalElementValueError>
pub const fn new(value: f64) -> Result<Self, OrbitalElementValueError>
Creates a unitless orbital element value from a finite number.
§Errors
Returns OrbitalElementValueError::NonFiniteValue when value is not finite.
Sourcepub fn with_unit(
value: f64,
unit_label: impl AsRef<str>,
) -> Result<Self, OrbitalElementValueError>
pub fn with_unit( value: f64, unit_label: impl AsRef<str>, ) -> Result<Self, OrbitalElementValueError>
Creates an orbital element value with a non-empty unit label.
§Errors
Returns OrbitalElementValueError::NonFiniteValue when value is not finite, or
OrbitalElementValueError::EmptyUnitLabel when the trimmed unit label is empty.
pub const fn value(&self) -> f64
pub fn unit_label(&self) -> Option<&str>
Trait Implementations§
Source§impl Clone for OrbitalElementValue
impl Clone for OrbitalElementValue
Source§fn clone(&self) -> OrbitalElementValue
fn clone(&self) -> OrbitalElementValue
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 OrbitalElementValue
impl Debug for OrbitalElementValue
Source§impl PartialEq for OrbitalElementValue
impl PartialEq for OrbitalElementValue
Source§fn eq(&self, other: &OrbitalElementValue) -> bool
fn eq(&self, other: &OrbitalElementValue) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OrbitalElementValue
Auto Trait Implementations§
impl Freeze for OrbitalElementValue
impl RefUnwindSafe for OrbitalElementValue
impl Send for OrbitalElementValue
impl Sync for OrbitalElementValue
impl Unpin for OrbitalElementValue
impl UnsafeUnpin for OrbitalElementValue
impl UnwindSafe for OrbitalElementValue
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