pub struct CelestialTime {
pub sun: Option<Position>,
pub moon: Option<Position>,
pub phase: Option<MoonPhase>,
}Expand description
A sky stated in a designer’s words: one body, where it stands, and —
where the moon shows — its phase (spec-0081 §3.1). Exactly one of sun and
moon (DW0931).
Fields§
§sun: Option<Position>Where the sun stands. Exclusive with moon.
moon: Option<Position>Where the moon stands. Exclusive with sun.
phase: Option<MoonPhase>The moon’s phase. Required on world.time whenever the moon is at or
above the horizon at the stated position, refused wherever it is below.
Absent on a set-time, a design row or a camera sky = the world’s.
Implementations§
Source§impl CelestialTime
impl CelestialTime
Sourcepub fn stated(self) -> Option<(Body, Position)>
pub fn stated(self) -> Option<(Body, Position)>
The one body this statement names and where it stands, or None when it
names neither or both (DW0931).
Sourcepub fn daytime(self) -> i64
pub fn daytime(self) -> i64
The daytime tick this statement names. A statement naming neither or
both bodies is refused by DW0931 before anything reads its hour; it
reads as its sun if it has one, else its moon, else noon, so the
function is total.
Sourcepub fn moon_altitude_centideg(self) -> i32
pub fn moon_altitude_centideg(self) -> i32
The moon’s altitude at the stated position, in hundredths of a degree.
Sourcepub fn moon_shows(self) -> bool
pub fn moon_shows(self) -> bool
Whether the moon is at or above the horizon at the stated position.
Trait Implementations§
Source§impl Clone for CelestialTime
impl Clone for CelestialTime
impl Copy for CelestialTime
Source§impl Debug for CelestialTime
impl Debug for CelestialTime
Source§impl<'de> Deserialize<'de> for CelestialTime
impl<'de> Deserialize<'de> for CelestialTime
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for CelestialTime
Source§impl Hash for CelestialTime
impl Hash for CelestialTime
Source§impl JsonSchema for CelestialTime
impl JsonSchema for CelestialTime
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more