rust_language

package
v0.0.0-...-aef7695 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Builtins = map[string]bool{

	"std":   true,
	"core":  true,
	"alloc": true,
	"test":  true,

	"proc_macro": true,

	"rustfmt": true,
	"clippy":  true,

	"bool": true,
	"char": true,
	"str":  true,

	"f32": true,
	"f64": true,

	"i8":   true,
	"i16":  true,
	"i32":  true,
	"i64":  true,
	"i128": true,

	"u8":   true,
	"u16":  true,
	"u32":  true,
	"u64":  true,
	"u128": true,

	"isize": true,
	"usize": true,
}

modules provided by rust

View Source
var Provided = map[string]map[string]label.Label{
	// contains filtered or unexported fields
}

crates provided by rules_rust

Functions

func CloneRule

func CloneRule(oldRule *rule.Rule) *rule.Rule

It's nice to be able to re-use existing Rules so that we can resolve them but preserve the grouping of srcs, which is not something Gazelle handles natively. By making a new rule with the attrs that we want to preserve (e.g., srcs), we preserve the existing groupings. If we were to reuse the existing rule without cloning it, certain things like #keep comments stop working.

func NewLanguage

func NewLanguage() language.Language

func ReadResponse

func ReadResponse[M proto.Message](p *Parser, response M) error

func SliceContains

func SliceContains(slice []string, value string) bool

Types

type LockfileCrates

type LockfileCrates struct {
	Crates map[resolve.ImportSpec]string
	// track which crates have been used so that we can report unused crates
	UsedCrates map[string]bool
}

func EmptyLockfileCrates

func EmptyLockfileCrates() *LockfileCrates

func (*LockfileCrates) UnusedCrates

func (l *LockfileCrates) UnusedCrates(allowedUnusedCrates map[string]bool) []string

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser() *Parser

func (*Parser) GetLockfileCrates

func (p *Parser) GetLockfileCrates(request *pb.LockfileCratesRequest) (*pb.LockfileCratesResponse, error)

func (*Parser) Parse

func (p *Parser) Parse(request *pb.RustImportsRequest) (*pb.RustImportsResponse, error)

func (*Parser) ParseCargoToml

func (p *Parser) ParseCargoToml(request *pb.CargoTomlRequest) (*pb.CargoTomlResponse, error)

func (*Parser) WriteRequest

func (p *Parser) WriteRequest(request *pb.Request) error

type RuleData

type RuleData struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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