On this page
Cargo (Rust) release target with round-trip Cargo.toml editing via tomlkit, asset builds, dev-install support, and hybrid publish via CARGO_REGISTRY_TOKEN.
#rlsbl.targets.cargo
#rlsbl.targets.cargo
Cargo (Rust) release target that uses tomlkit for round-trip Cargo.toml editing with hybrid publish support via CARGO_REGISTRY_TOKEN.
#CargoTarget
Release target for Rust/Cargo projects (Cargo.toml).
#name
def name(self)#read_name
def read_name(self, dir_path)Read the package name from Cargo.toml.
#read_metadata
def read_metadata(self, dir_path)Read license and description from Cargo.toml.
#detect
def detect(self, dir_path)Detect if dir has a Cargo.toml with a [package] section (not workspace-only).
#read_version
def read_version(self, dir_path)Read version from Cargo.toml [package].version.
#write_version
def write_version(self, dir_path, version)Write version to Cargo.toml using tomlkit round-trip (preserves comments).
Returns a list of relative file paths that were modified.
#version_file
def version_file(self)#tag_format
def tag_format(self, version)#_is_library
def _is_library(self, dir_path)Return True if the crate is a library (no binary target).
#template_dir
def template_dir(self)#template_vars
def template_vars(self, dir_path)Extract template variables from Cargo.toml.
#template_mappings
def template_mappings(self)#build_assets
def build_assets(self, dir_path, version, dist_dir)Build Rust binary in release mode and copy to dist_dir.
#publish
def publish(self, dir_path, version)Publish to crates.io based on per-target config and token availability.
#check_project_exists
def check_project_exists(self, dir_path)#get_project_init_hint
def get_project_init_hint(self)#dev_install_command
def dev_install_command(self, project_dir)