starlane_space::space::point

Type Alias PointCtx

Source
pub type PointCtx = PointDef<RouteSeg, PointSegCtx>;
Expand description

A Point with potential contextual information for example one with a working dir: .:mechtrons:mechtron the single . works the same as in unix shell and refers to the working location. You can also reference parent hierarchies just as you would expect: ..:another-app:something

In order to create an absolute Point from a PointCtx one must call the PointCtx::to_resolved(&env) method with a proper Env (environment) reference which should have a contextual point set:

use std::str::FromStr;
use starlane_space::loc::Point;
use starlane_space::loc::PointCtx;
let point_var = PointCtx::from_str("..:another-app:something")?;
let point: Point = point_ctx.to_resolve(&env)?;

Aliased Type§

struct PointCtx {
    pub route: RouteSeg,
    pub segments: Vec<PointSegCtx>,
}

Fields§

§route: RouteSeg§segments: Vec<PointSegCtx>

Implementations§

Trait Implementations§

Source§

impl FromStr for PointCtx

Source§

type Err = ParseErrs

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl ToResolved<PointDef<RouteSeg, PointSeg>> for PointCtx

Source§

impl TryInto<PointDef<RouteSeg, PointSeg>> for PointCtx

Source§

type Error = ParseErrs

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

fn try_into(self) -> Result<Point, Self::Error>

Performs the conversion.