SpaceTimeKind

Enum SpaceTimeKind 

Source
pub enum SpaceTimeKind {
    Euclidean(EuclideanSpacetime),
    Lorentzian(LorentzianSpacetime),
    Minkowski(MinkowskiSpacetime),
    Tangent(TangentSpacetime),
}
Expand description

A polymorphic enum over supported spacetime context types.

SpaceTimeKind provides a unified abstraction over multiple spacetime representations. It enables algorithms to generically operate over different mathematical models of space and time without requiring monomorphic type coupling.

This type implements key traits such as Coordinate, Temporal, Spatial, and SpaceTemporal to enable high-level reasoning, measurement, and causal modeling in spacetime-aware systems.

§Supported Variants

§Examples

use deep_causality::*;

let euclidean = EuclideanSpacetime::new(1, 0.0, 0.0, 0.0, 1.0, TimeScale::Second);
let spacetime = SpaceTimeKind::Euclidean(euclidean);

assert_eq!(spacetime.dimension(), 4);
assert_eq!(spacetime.time_unit(), 1.0);

§Trait Support

SpaceTimeKind implements:

§Index Mapping

Coordinate indexing depends on the inner type variant. The most common mapping is:

  • 0 => x
  • 1 => y
  • 2 => z
  • 3 => t

§Notes

  • This abstraction is ideal for heterogeneous systems that must support multiple physical or geometric models simultaneously (e.g., causal simulation engines, robotics frameworks, or time-aware decision systems).

Variants§

§

Euclidean(EuclideanSpacetime)

Classical Newtonian spacetime (ℝ³ + time)

§

Lorentzian(LorentzianSpacetime)

General relativistic curved spacetime

§

Minkowski(MinkowskiSpacetime)

Special relativistic flat spacetime (Minkowski space)

§

Tangent(TangentSpacetime)

Tangent space at a point, used for local linearization of curvature

Trait Implementations§

Source§

impl Clone for SpaceTimeKind

Source§

fn clone(&self) -> SpaceTimeKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Coordinate<f64> for SpaceTimeKind

Source§

fn dimension(&self) -> usize

Returns the number of dimensions defined in this coordinate system.
Source§

fn coordinate(&self, index: usize) -> Result<&f64, IndexError>

Returns a reference to the value at a given axis index (0-based). Read more
Source§

impl Debug for SpaceTimeKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SpaceTimeKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Identifiable for SpaceTimeKind

Source§

fn id(&self) -> u64

Source§

impl PartialEq for SpaceTimeKind

Source§

fn eq(&self, other: &SpaceTimeKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl SpaceTemporal<f64, f64> for SpaceTimeKind

Source§

fn t(&self) -> &f64

Returns the value associated with the temporal (4th) dimension.
Source§

impl Temporal<f64> for SpaceTimeKind

Source§

fn time_scale(&self) -> TimeScale

Returns the unit scale of time (e.g. TimeScale::Milliseconds).
Source§

fn time_unit(&self) -> f64

Returns a reference to the numeric time unit (e.g. 0, 100, 32768).
Source§

impl Spatial<f64> for SpaceTimeKind

Source§

impl StructuralPartialEq for SpaceTimeKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Satisfies<NoConstraint> for T