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

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.

主站蜘蛛池模板: 仙游县| 开原市| 乐山市| 丽江市| 元谋县| 二连浩特市| 安溪县| 奈曼旗| 江安县| 时尚| 红河县| 微山县| 石嘴山市| 伊川县| 双柏县| 于田县| 岢岚县| 民权县| 和田县| 台湾省| 江西省| 靖西县| 波密县| 朔州市| 临洮县| 萨嘎县| 兰坪| 池州市| 南丰县| 枝江市| 新密市| 蚌埠市| 永吉县| 香港| 墨竹工卡县| 长宁区| 扎赉特旗| 蛟河市| 石屏县| 神池县| 长顺县|