rust

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package rust contains shared behaviors for the rustbuddy commands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enum

type Enum struct {
	Span     Span
	Name     string
	Variants []string
}

Enum is an Enumeration of types in rust

type Fn

type Fn struct {
	Span   Span
	Name   string
	Args   []string
	Return string
}

Fn is a function in rust

type RsStruct

type RsStruct struct {
	Span    Span
	Name    string
	Methods []Fn
	Traits  []Trait
}

RsStruct is a data structure specific to rust source code. The awkward name is to avoid using a keyword

type Source

type Source struct {
	Funcs     []Fn
	RsStructs []RsStruct
	Enums     []Enum
	Traits    []Trait
	Tests     []Test
	TestBlock int
	UB        []Unsafe
}

Source is a data structure representing the basic lexical structure of a rust source code file.

func Parse

func Parse(f *os.File) (Source, error)

Parse reads rust source code and does a simple lexical analysis

type Span

type Span struct {
	Start scanner.Position
	End   scanner.Position
}

Span is the start end end location of a code block

type Test

type Test struct {
	Name string
	Span Span
}

Test refers to unit tests already within the source

type Trait

type Trait struct {
	Span Span
	Name string
}

Trait refers to Rust trait name. Currently, there is no use for the body of a trait definition.

type Unsafe

type Unsafe struct {
	Span Span
}

Unsafe are blocks of code marked unsafe

Jump to

Keyboard shortcuts

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