cargo

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cargo contains helper functions for building Rust applications using cargo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(env env.ExecEnv, release bool, target string, features []string) (string, error)

Build builds a Rust program using `cargo` in the current working directory.

Types

type Dependency added in v0.10.4

type Dependency struct {
	Name     string   `json:"name"`
	Features []string `json:"features"`
}

Dependency is the metadata about a dependency.

func (*Dependency) HasFeature added in v0.10.4

func (d *Dependency) HasFeature(feature string) bool

HasFeature returns true iff the given feature is present among the features.

type Metadata

type Metadata struct {
	Name         string
	Version      string
	Dependencies []Dependency
}

Metadata is the cargo package metadata.

func GetMetadata

func GetMetadata(env env.ExecEnv) (*Metadata, error)

GetMetadata queries `cargo` for metadata of the package in the current working directory.

func (*Metadata) FindDependency added in v0.10.4

func (m *Metadata) FindDependency(name string) *Dependency

FindDependency finds the first dependency with the given name and returns it. Iff no such dependency can be found, it returns nil.

Jump to

Keyboard shortcuts

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