Enum nyx_space::cosmic::eclipse::EclipseState
source · pub enum EclipseState {
Umbra,
Penumbra(f64),
Visibilis,
}
Expand description
Stores the eclipse state
Variants§
Umbra
Penumbra(f64)
The f64 is between ]0; 1[ and corresponds to the percentage of penumbra: the closer to 1, the more light is seen.
Visibilis
Trait Implementations§
source§impl Clone for EclipseState
impl Clone for EclipseState
source§fn clone(&self) -> EclipseState
fn clone(&self) -> EclipseState
Returns a copy of the value. Read more
1.0.0 · 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 EclipseState
impl Debug for EclipseState
source§impl Display for EclipseState
impl Display for EclipseState
source§impl Into<f64> for EclipseState
impl Into<f64> for EclipseState
source§impl Ord for EclipseState
impl Ord for EclipseState
source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Orders eclipse states to the greatest eclipse.
Examples
extern crate nyx_space as nyx;
use nyx::cosmic::eclipse::EclipseState;
assert!(EclipseState::Umbra == EclipseState::Umbra);
assert!(EclipseState::Visibilis == EclipseState::Visibilis);
assert!(EclipseState::Penumbra(0.5) == EclipseState::Penumbra(0.5));
assert!(EclipseState::Umbra > EclipseState::Penumbra(0.1));
assert!(EclipseState::Umbra > EclipseState::Penumbra(0.9));
assert!(EclipseState::Penumbra(0.1) < EclipseState::Umbra);
assert!(EclipseState::Penumbra(0.9) < EclipseState::Umbra);
assert!(EclipseState::Penumbra(0.9) > EclipseState::Visibilis);
assert!(EclipseState::Visibilis < EclipseState::Penumbra(0.9));
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<EclipseState> for EclipseState
impl PartialEq<EclipseState> for EclipseState
source§fn eq(&self, other: &EclipseState) -> bool
fn eq(&self, other: &EclipseState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<EclipseState> for EclipseState
impl PartialOrd<EclipseState> for EclipseState
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for EclipseState
impl Eq for EclipseState
impl StructuralPartialEq for EclipseState
Auto Trait Implementations§
impl RefUnwindSafe for EclipseState
impl Send for EclipseState
impl Sync for EclipseState
impl Unpin for EclipseState
impl UnwindSafe for EclipseState
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Printing<T> for Twhere
T: Display,
impl<T> Printing<T> for Twhere T: Display,
§fn to_str(self) -> String
fn to_str(self) -> String
Method to serialize.
Decorates Vecs with square brackets and tuples with round ones.
Implementation code is in
printing.rs
. §fn to_plainstr(self) -> String
fn to_plainstr(self) -> String
Method to serialize in minimal form (space separated, no brackets)
Implementation code is in
printing.rs
.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.