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: PositionWhere the leg starts, as lat,lon in degrees.
to: PositionWhere the leg ends, as lat,lon in degrees.
Route
Check a route given straight on the command line, leg by leg.
Fields
Find
Find the shortest route between two positions that check_leg calls safe, instead of checking one already drawn.
Fields
from: PositionWhere the route starts, as lat,lon in degrees.
to: PositionWhere 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”.
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: PositionThe harbour’s own nominal position, as lat,lon in degrees.
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: PositionWhere the passage starts, as lat,lon in degrees – a pier
or anchorage, the same nominal position gateway --harbor
takes.
to: PositionWhere the passage ends, the same way.
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
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: boolNever 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: PathBufWhere 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.
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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