Skip to main content

Task

Enum Task 

pub(crate) enum Task {
    GenerateAll {
        mode: Mode,
    },
    CheckParity {
        rust_golden: bool,
    },
    RunExamples,
    CheckApiLinks {
        doc_dir: Option<PathBuf>,
        site_dir: Option<PathBuf>,
    },
    CheckGuideLinks,
    CheckLints,
}
Expand description

The tasks.

Variants§

§

GenerateAll

Write, check or print every generated documentation page.

Fields

§mode: Mode

What to do with the pages.

§

CheckParity

Assert that paired examples agree bit-for-bit across the binding.

Without a flag, both arms of every examples/parity.toml pair run and their atune-parity/1 blocks are compared — which needs the Python wheel installed. With --rust-golden, only the Rust arms run and each is compared to its committed golden, which needs nothing but the workspace and therefore belongs in the fast per-push gate (§11).

§If it dies before printing anything

error while loading shared libraries: libpython3.NN.so.1.0 is the loader, not this command. atune_dev links atune_python, which embeds a real interpreter, so the binary needs libpython at load time — before main runs, which is why the message names neither a crate nor a task. A system interpreter usually leaves it somewhere the loader already looks; a uv- or pyenv-managed one does not. Fix by pointing the loader at that interpreter’s own library directory:

LD_LIBRARY_PATH=$(python3 -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))') \
    cargo dev check-parity

Written down here because the failure is met while running this, and a bare loader error is exactly the kind of message somebody spends an hour on twice.

Fields

§rust_golden: bool

Compare each Rust arm to its committed golden instead of to Python.

§

RunExamples

Run every example under examples/rust/.

Every one, not only the paired ones: running only the pairs would leave the unpaired examples compiled but never executed (G3).

Assert that every link in the API map resolves to a page that exists.

generate-all --mode check proves the map matches the code. This proves the map matches the published output: every rust: path is a file in the rustdoc tree, every page in the facade’s subtree of that tree is claimed by some key, and every python:/cli: anchor is an id on the page it names. It therefore needs both build artefacts, and belongs in docs.yml rather than the fast per-push gate (§11).

Fields

§doc_dir: Option<PathBuf>

The rustdoc tree. Defaults to cargo metadata’s target directory plus /doc — never a hardcoded target/doc, which is wrong whenever CARGO_TARGET_DIR is set (§1.3.42).

§site_dir: Option<PathBuf>

The built site. Defaults to site/.

Assert that every citation of the guide names a page that exists.

G15, and the other half of check-api-links: that command resolves the links a page makes through docs/api_links.yml, this one resolves the links prose makes to the guide itself — a doc comment, a README, a runtime message. Three checks: no blob/main repository link survives outside docs/design/, every site-absolute citation names a real docs/**.md, and no generated page republishes a site-absolute URL where a page-relative one is verifiable. Needs no build artefact, so it belongs in the fast per-push gate (§11).

§

CheckLints

Assert that atune_py’s hand-copied lint table still mirrors the workspace’s, and that its unsafe is still only the recorded operations.

atune_py is the one crate that cannot write [lints] workspace = true — inheriting would re-impose unsafe_code = "forbid", which its PyO3 bridge cannot build under — so it copies the whole table with that single value relaxed to deny. Nothing else notices when the two drift, and the crate that would silently stop enforcing a lint is the only one in the workspace that writes unsafe.

The second half bounds what the relaxation bought. deny is overridable from inside the crate by an #[allow(unsafe_code)] on any item, so the manifest permits unsafe without saying how much; the command parses the crate’s sources and holds every hand-written unsafe to a written-down inventory. Reads two manifests and one small source tree, so it belongs in the fast per-push gate.

Trait Implementations§

§

impl Debug for Task

§

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

Formats the value using the given formatter. Read more
§

impl FromArgMatches for Task

§

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

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

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

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

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

Assign values from ArgMatches to self.
§

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

Assign values from ArgMatches to self.
§

impl Subcommand for Task

§

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

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

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
§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

§

impl Freeze for Task

§

impl RefUnwindSafe for Task

§

impl Send for Task

§

impl Sync for Task

§

impl Unpin for Task

§

impl UnsafeUnpin for Task

§

impl UnwindSafe for Task

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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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<T> Ungil for T
where T: Send,

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more