Crate inwelling

Crate inwelling 

Source
Expand description

§Project Goal

To provide a mechanism for upstream crates to collect information from downstream crates.

§Information collected from downstream crates

Invoking collect_downstream() will collect the following information from crates which called inwelling::to() in its build.rs.

  • Package name.

  • Metadata defined in Cargo.toml.

  • Manifest paths of Cargo.toml.

  • Source file paths(optional). Call collect_downstream() with the argument inwelling::Opt::dump_rs_paths == true to collect.

§Quickstart

  1. The upstream crate e.g. crate foo calls inwelling::collect_downstream() in its build.rs and do whatever it want to generate APIs for downstream.

  2. The downstream crate e.g. crate bar calls inwelling::to() in its build.rs.

    // build.rs
    fn main() { inwelling::to( "foo" ); }

    To send some metadata to upstream crate foo, encode them in Cargo.toml’s package metadata.

    [package.metadata.inwelling.foo]
    answer = { type = "integer", value = "42" }

Structs§

Downstream
Information collected from downstream crates.
Opts
Options passed to inwelling().
Package
Information collected from one downstream crate. Including:

Functions§

collect_downstream
Collects information from downstream crates. Including:
to
Allow the upstream crate to collect information from this crate.