Documentation ¶
Overview ¶
Package rust provides a backend for Rust using Cargo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RustBackend = api.LanguageBackend{ Name: "rust", Specfile: "Cargo.toml", Lockfile: "Cargo.lock", IsAvailable: cargoIsAvailable, FilenamePatterns: []string{"*.rs"}, GetPackageDir: func() string { return "target" }, Search: search, Info: info, Add: func(ctx context.Context, pkgs map[api.PkgName]api.PkgSpec, projectName string) { span, ctx := tracer.StartSpanFromContext(ctx, "cargo add") defer span.Finish() if !util.Exists("Cargo.toml") { util.RunCmd([]string{"cargo", "init", "."}) } cmd := []string{"cargo", "add"} for name, spec := range pkgs { arg := string(name) if spec != "" { arg += "@" + string(spec) } cmd = append(cmd, arg) } util.RunCmd(cmd) }, Remove: func(ctx context.Context, pkgs map[api.PkgName]bool) { span, ctx := tracer.StartSpanFromContext(ctx, "cargo rm") defer span.Finish() cmd := []string{"cargo", "rm"} for name := range pkgs { cmd = append(cmd, string(name)) } util.RunCmd(cmd) }, Lock: func(ctx context.Context) { }, Install: func(ctx context.Context) { }, ListSpecfile: listSpecfile, ListLockfile: listLockfile, Guess: func(ctx context.Context) (map[string][]api.PkgName, bool) { util.NotImplemented() return nil, false }, InstallReplitNixSystemDependencies: nix.DefaultInstallReplitNixSystemDependencies, }
RustBackend is a UPM backend for Rust that uses Cargo.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.