doc/Rust-crates.md
There are 3 crates: mediasoup, mediasoup-sys and mediasoup-types:
mediasoup-sys crate wraps C++ worker into Rust.mediasoup-types crate defines and exposes mediasoup Rust types.mediasoup crate uses mediasoup-sys and mediasoup-types and it exposes nice user API in idiomatic Rust.mediasoup-sys is the only one that needs updating if changes are purely inside the worker or inside the mediasoup-sys crate. You can bump them all, but it is not required.mediasoup-sys's API changes in a breaking way, then its minor version needs to be changed, otherwise patch version needs to be changed. Same for mediasoup-types crate.Important: Adding new APIs that mediasoup crate has to understand to continue working normally is a breaking change because it'll start crashing/printing errors if unexpected things happen.
worker/Cargo.toml (for mediasoup-sys crate), rust/types/Cargo.toml (for mediasoup-types crate) and rust/Cargo.toml (for mediasoup crate). Note that in rust/Cargo.toml you may need to update the version of [dependencies.mediasoup-sys] and/or [dependencies.mediasoup-types] if they also changed.rust/CHANGELOG.md.cargo build to reflect changes in Cargo.lock.rust/CHANGELOG.md, so the new mediasoup crate version):git tag -a rust-X.X.X -m rust-X.X.X
git push origin rust-X.X.X
cd rust/types
cargo publish
cd worker
cargo publish
cd rust
cargo publish
worker directory you may need to run invoke clean-all or make clean-all in worker directory first.KEEP_BUILD_ARTIFACTS=1 exported in your shell (handy to speed up regular local builds) and still publish: mediasoup-sys's build.rs detects the cargo publish / cargo package verification step (Cargo builds the crate inside target/package/) and always cleans the Meson subprojects it extracts into the source tree, regardless of KEEP_BUILD_ARTIFACTS. This avoids the "Source directory was modified by build.rs" error.cargo publish will create the crate package, check if all necessary dependencies are already present on crates.io, will then compile the package (to ensure that you don't publish a broken version) and will upload it to crates.io.cargo publish --dry-run, which creates the package and compiles it for verification but does not upload anything.cargo publish --dry-run -p mediasoup-types -p mediasoup-sys -p mediasoup
cargo package.cargo package --list.Using rustup command:
rustup update