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 for EclipseState
impl PartialEq 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 for EclipseState
impl PartialOrd 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 Freeze for EclipseState
impl RefUnwindSafe for EclipseState
impl Send for EclipseState
impl Sync for EclipseState
impl Unpin for EclipseState
impl UnwindSafe for EclipseState
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§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.