pub struct StellarMass(/* private fields */);Implementations§
Source§impl StellarMass
impl StellarMass
Sourcepub const fn new(value: f64) -> Result<Self, StarError>
pub const fn new(value: f64) -> Result<Self, StarError>
Creates a stellar mass from a finite, non-negative solar-mass value.
§Errors
Returns StarError::NonFiniteMass when value is not finite, or
StarError::NegativeMass when value is negative.
pub const fn solar_masses(self) -> f64
Trait Implementations§
Source§impl Clone for StellarMass
impl Clone for StellarMass
Source§fn clone(&self) -> StellarMass
fn clone(&self) -> StellarMass
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 StellarMass
impl Debug for StellarMass
Source§impl Display for StellarMass
impl Display for StellarMass
Source§impl PartialEq for StellarMass
impl PartialEq for StellarMass
Source§fn eq(&self, other: &StellarMass) -> bool
fn eq(&self, other: &StellarMass) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for StellarMass
impl PartialOrd for StellarMass
impl Copy for StellarMass
impl StructuralPartialEq for StellarMass
Auto Trait Implementations§
impl Freeze for StellarMass
impl RefUnwindSafe for StellarMass
impl Send for StellarMass
impl Sync for StellarMass
impl Unpin for StellarMass
impl UnsafeUnpin for StellarMass
impl UnwindSafe for StellarMass
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