rust

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package rust provides Rust specific functionality for librarian.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bump added in v0.8.1

func Bump(ctx context.Context, library *config.Library, output, version, gitExe, lastTag string) error

Bump checks if a version bump is required and performs it. It returns without error if no bump is needed (version already updated since lastTag).

func DefaultLibraryName added in v0.8.1

func DefaultLibraryName(api string) string

DefaultLibraryName derives a library name from an api path. For example: google/cloud/secretmanager/v1 -> google-cloud-secretmanager-v1.

func DefaultOutput

func DefaultOutput(api, defaultOutput string) string

DefaultOutput derives an output path from an api path and default output. For example: google/cloud/secretmanager/v1 with default src/generated/ returns src/generated/cloud/secretmanager/v1.

func DeriveAPIPath added in v0.8.1

func DeriveAPIPath(name string) string

DeriveAPIPath derives an api path from a library name. For example: google-cloud-secretmanager-v1 -> google/cloud/secretmanager/v1.

func Format

func Format(ctx context.Context, library *config.Library) error

Format formats a generated Rust library. Must be called sequentially; parallel calls cause race conditions as cargo fmt runs cargo metadata, which competes for locks on the workspace Cargo.toml and Cargo.lock.

func Generate

func Generate(ctx context.Context, library *config.Library, sources *source.Sources) error

Generate generates a Rust client library.

func Keep

func Keep(library *config.Library) ([]string, error)

Keep returns the list of files to preserve when cleaning the output directory.

func Publish

func Publish(ctx context.Context, config *config.Release, dryRun, dryRunKeepGoing, skipSemverChecks bool) error

Publish finds all the crates that should be published. It can optionally run in dry-run mode, dry-run mode with continue on errors, and/or skip semver checks.

func UpdateWorkspace added in v0.8.1

func UpdateWorkspace(ctx context.Context) error

UpdateWorkspace updates dependencies for the entire Rust workspace.

Types

type Cargo

type Cargo struct {
	Package *CrateInfo `toml:"package"`
}

Cargo is a wrapper for CrateInfo for parsing Cargo.toml files.

type CrateInfo

type CrateInfo struct {
	Name    string `toml:"name"`
	Version string `toml:"version"`
	Publish bool   `toml:"publish"`
}

CrateInfo contains the package information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL