Skip to main content

Command

Enum Command 

Source
pub(crate) enum Command {
    Leg {
        chart: ChartArgs,
        from: Position,
        to: Position,
    },
    Route {
        chart: ChartArgs,
        name: Option<String>,
        waypoints: Vec<Position>,
    },
    Find {
        chart: ChartArgs,
        from: Position,
        to: Position,
        margin: Option<f64>,
        cell: Option<f64>,
        gpx: Option<PathBuf>,
        avoid_restricted: bool,
    },
    Gateway {
        chart: ChartArgs,
        harbor: Position,
        avoid_restricted: bool,
        route: bool,
    },
    DockToDock {
        chart: ChartArgs,
        from: Position,
        to: Position,
        avoid_restricted: bool,
    },
    Bake {
        chart: PathBuf,
        out: Option<PathBuf>,
    },
    Bench {
        chart: ChartArgs,
        avoid_restricted: bool,
        baseline: PathBuf,
        write_baseline: bool,
    },
}

Variants§

§

Leg

Check a single leg between two positions.

Fields

§from: Position

Where the leg starts, as lat,lon in degrees.

§to: Position

Where the leg ends, as lat,lon in degrees.

§

Route

Check a route given straight on the command line, leg by leg.

Fields

§name: Option<String>

What to call it, for the printed report only.

§waypoints: Vec<Position>

A waypoint, as lat,lon. Repeat, in the order they are sailed.

§

Find

Find the shortest route between two positions that check_leg calls safe, instead of checking one already drawn.

Fields

§from: Position

Where the route starts, as lat,lon in degrees.

§to: Position

Where the route ends, as lat,lon in degrees.

§margin: Option<f64>

How far beyond the direct line between the two the search may reach, in nautical miles. Left unset, it auto-scales from the direct distance and escalates a few times on its own if that is not enough. Given explicitly, it is tried exactly once – useful for asking “is N NM enough” rather than “find a way”.

§cell: Option<f64>

Lattice spacing for the coarse search, in nautical miles. Left unset, it auto-scales from the direct distance.

§gpx: Option<PathBuf>

Write the found route as a GPX 1.1 route file, in addition to printing it.

§avoid_restricted: bool

Never let the route cross a restricted area (RESARE), instead of only reporting it. Off by default, the same posture check_leg itself takes – most restricted areas restrict anchoring, not transit.

§

Gateway

Find the nearest point to a harbour’s own nominal position – dropped on a pier, an anchorage, or just a town’s own marker – that find can actually use as a from/to. See route_find::gateway’s own doc for the search and why it stops short of the pier itself.

Fields

§harbor: Position

The harbour’s own nominal position, as lat,lon in degrees.

§avoid_restricted: bool

Never let the search cross a restricted area, the same as find’s own flag.

§route: bool

Find a real, waypoint-by-waypoint route out to open water (route_find::find_gateway_route) instead of just the nearest usable point – a second approach, tried alongside the first rather than in place of it; see that function’s own doc.

§

DockToDock

A full harbour-to-harbour passage (route_find::find_dock_to_dock_route): each harbour’s own gateway, found the same way plain gateway does, with find’s own open-water search filling the middle.

Fields

§from: Position

Where the passage starts, as lat,lon in degrees – a pier or anchorage, the same nominal position gateway --harbor takes.

§to: Position

Where the passage ends, the same way.

§avoid_restricted: bool

Never let the search cross a restricted area, the same as find’s own flag.

§

Bake

Bake route-find’s own ahead-of-time land cache for a chart, so every later find (and every route a client finds via ffi) stops paying to fetch and simplify LNDARE on every query. Written next to the chart as <chart>.hazcache unless --out says otherwise; safe to re-run any time the chart itself changes, since a stale cache is detected and ignored rather than trusted.

The region to bake is detected automatically from the chart’s M_COVR coverage features, clustered by proximity so that stray coverage rows for unrelated areas do not widen it. Not specified on the command line, so the cache grows automatically as charts are added to the ingest pipeline.

Fields

§chart: PathBuf

The chart to bake a land cache for.

§out: Option<PathBuf>

Where to write the cache. Defaults to the chart’s own path with .hazcache appended.

§

Bench

Runs bench::REFERENCE_ROUTES against a chart and prints each route’s waypoint count, length and wall-clock time – a fixed set of measurements for judging whether a change to the search or its caches improved, regressed, or had no effect.

Exits non-zero if any reference route no longer finds a path, or, unless --write-baseline is given, if length or wall-clock time regresses past bench::distance_regressed/bench::time_regressed’s margin against --baseline’s stored numbers.

Fields

§avoid_restricted: bool

Never let a reference route cross a restricted area, the same as find’s own flag – kept off by default so bench measures the common case unless asked otherwise.

§baseline: PathBuf

Where this run’s own numbers are compared against (or, with --write-baseline, written to). Defaults to a file tracked alongside this crate’s own source, resolved at compile time so enc-check bench finds it from any working directory – plain route names, lengths and times, never chart data, so committing it carries none of the licensing weight a chart fixture would.

§write_baseline: bool

Overwrite --baseline with this run’s own numbers instead of comparing against them – the way to accept a change that genuinely made a route longer, slower, or both, on purpose.

Trait Implementations§

Source§

impl Debug for Command

Source§

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

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

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

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> 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

§

fn is_within(&self, b: &G2) -> bool