[][src]Struct mercator_db::space::Space

pub struct Space { /* fields omitted */ }

A reference space, defined by its name and coordinate system.

Methods

impl Space[src]

pub fn new<S>(name: S, system: CoordinateSystem) -> Self where
    S: Into<String>, 
[src]

Instantiate a new space.

Parameters

  • name: Id of the reference space.

  • system: Coordinate system defintion of the reference space

pub fn universe() -> &'static Self[src]

Returns the Universe Space.

This space contains all of the spaces, and allows us to connect them between each others.

pub fn change_base(
    position: &Position,
    from: &Space,
    to: &Space
) -> Result<Position, String>
[src]

Transform a position from space from into a position in space to.

Parameters

  • position: Position to transform, expressed as encoded coordinates.

  • from: Space in which position is defined.

  • to: Target space in which position should be expressed.

pub fn name(&self) -> &String[src]

Id of the reference space.

pub fn origin(&self) -> &Position[src]

Origin of the space, expressed in Universe.

pub fn axes(&self) -> &Vec<Axis>[src]

Axes definition of the space.

pub fn bounding_box(&self) -> (Position, Position)[src]

Returns the bounding box enclosing the whole space.

pub fn volume(&self) -> f64[src]

Total volume of the reference space.

pub fn decode(&self, position: &Position) -> Result<Vec<f64>, String>[src]

Decode coordinates expressed in the current space, to their values within the axes definitions.

Parameters

  • position: expressed in encoded coordinates within the current space.

Return value

The decoded position within the space.

pub fn encode(&self, position: &[f64]) -> Result<Position, String>[src]

Encode a position expressed in the current space within the axes value ranges.

Parameters

  • position: expressed in the current space.

Return value

The encoded coordinates within the space.

Trait Implementations

impl Clone for Space[src]

impl Debug for Space[src]

impl<'de> Deserialize<'de> for Space[src]

impl<'_> From<&'_ Space> for Space[src]

impl<'_> From<&'_ Space> for Space[src]

impl PartialEq<Space> for Space[src]

impl Record<String> for Space[src]

impl Serialize for Space[src]

impl StructuralPartialEq for Space[src]

Auto Trait Implementations

impl RefUnwindSafe for Space

impl Send for Space

impl Sync for Space

impl Unpin for Space

impl UnwindSafe for Space

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.