官术网_书友最值得收藏!

Publishing

For developers to get their crate into this repository, cargo harbors a command: cargo publish. The command is actually doing more things behind the scenes: first it runs the cargo package to create a *.crate file that contains everything that is uploaded. Then it verifies the contents of the package by essentially running cargo test and checks whether there are any uncommitted files in the local repository. Only if these checks pass does cargo upload the contents of the *.crate file to the repository. This requires a valid account on crates.io (available with your GitHub login) to acquire your personal secret API token, and the crate has to follow certain rules.

With the previously-mentioned Wasm target, it's even possible to publish Rust packages to the famous JavaScript package repository: npm Keep in mind that Wasm support is still very new, but once a crate compiles to Wasm it can be packed into an npm package using Wasm-pack: https://github.com/rustwasm/wasm-pack.

crates.io aspires to be a permanent storage for Rust crates, so there is no "unpublish" button. Versions can be yanked with cargo yank, but this won't delete any code; it will just prohibit updates to this particular version. Additionally there can be team structures, colorful READMEs, badges, and so on, on your repository's site and we highly recommend you check out the docs on that as well: https://doc.rust-lang.org/cargo/reference/publishing.html.

主站蜘蛛池模板: 喜德县| 花莲县| 稻城县| 水富县| 金门县| 防城港市| 彭水| 栖霞市| 铜川市| 尖扎县| 虎林市| 房山区| 佛冈县| 游戏| 平凉市| 慈溪市| 玉树县| 浪卡子县| 临清市| 桦川县| 阳城县| 长泰县| 甘洛县| 扬中市| 土默特右旗| 壤塘县| 阳东县| 龙泉市| 衡南县| 双辽市| 民县| 博爱县| 崇阳县| 新安县| 肃北| 龙海市| 临沭县| 兰考县| 琼海市| 洪江市| 苏尼特左旗|