Documentation ¶
Index ¶
- Variables
- func CloneRule(oldRule *rule.Rule) *rule.Rule
- func NewLanguage() language.Language
- func ReadResponse[M proto.Message](p *Parser, response M) error
- func SliceContains(slice []string, value string) bool
- type LockfileCrates
- type Parser
- func (p *Parser) GetLockfileCrates(request *pb.LockfileCratesRequest) (*pb.LockfileCratesResponse, error)
- func (p *Parser) Parse(request *pb.RustImportsRequest) (*pb.RustImportsResponse, error)
- func (p *Parser) ParseCargoToml(request *pb.CargoTomlRequest) (*pb.CargoTomlResponse, error)
- func (p *Parser) WriteRequest(request *pb.Request) error
- type RuleData
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 ¶
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 SliceContains ¶
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 (*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)
Click to show internal directories.
Click to hide internal directories.