Documentation ¶
Overview ¶
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Package types contains structs/interfaces representing Rust types
Index ¶
- type Any
- type Array
- type Boolean
- type Common
- type Date
- type Enum
- type EnumVariant
- type Enumerable
- type Function
- type FunctionParam
- type Map
- type NamedType
- type Nullable
- type Number
- type Primitive
- type RawNumberEnumCandidate
- type RawStringEnumCandidate
- type Result
- type Stream
- type String
- type Struct
- type StructField
- type Trait
- type Tuple
- type Type
- type Unit
- type Vec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Any ¶
type Any struct {
Common
}
Any represents a dynamic type in Rust (dyn Any)
func (*Any) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map. dyn Any cannot be used as a map key since it doesn't implement Hash/Eq.
type Array ¶
Array represents a fixed-size array type in Rust ([T; N])
func (*Array) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as a map key. Arrays cannot be used as map keys since they don't implement Hash/Eq.
type Boolean ¶
type Boolean struct {
Common
}
Boolean - boolean in Rust
func (*Boolean) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type Common ¶
type Common struct { // PkgName is the package name declared at the beginning of .go files. // Currently, only exported types in the root package is available. PkgName string Position *token.Position }
Common defines common fields in the all types
func (*Common) GetPackageName ¶ added in v0.1.2
GetPackageName returns PkgName in Common
func (*Common) GetPosition ¶ added in v0.1.2
GetPosition returns Position in Common
func (*Common) SetPackageName ¶ added in v0.1.2
SetPackageName sets PkgName in Common
func (*Common) SetPosition ¶ added in v0.1.2
SetPosition sets Position in Common
type Date ¶
type Date struct {
Common
}
Date - RFC3399 string in Rust
func (*Date) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type Enum ¶ added in v0.1.2
type Enum struct { Common Name string Variants map[string]EnumVariant }
Enum - enum in Rust
func (*Enum) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type EnumVariant ¶ added in v0.1.2
type EnumVariant struct { RawName string RawTag string FieldIndex int Type Type Position *token.Position }
EnumVariant represents a variant in an enum
type Enumerable ¶
type Enumerable interface { Type // AddCandidates adds a candidate for enum AddCandidates(key string, v interface{}) }
Enumerable interface represents union types
type Function ¶ added in v0.1.2
type Function struct { Common Name string IsMethod bool IsAsync bool Params []FunctionParam // Changed from map to slice to preserve order Returns Type // Changed from ReturnVal for consistency Receiver Type // For methods, represents self type }
Function represents a function or method in Rust
func (*Function) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type FunctionParam ¶ added in v0.1.2
FunctionParam represents a parameter in a function
type Map ¶
Map represents a HashMap<K,V> type in Rust
func (*Map) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as a map key. Maps cannot be used as map keys since they don't implement Hash/Eq.
type Nullable ¶
Nullable - ... i.e. Option in Rust
func (*Nullable) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type Number ¶
type Number struct { Common Name string RawType types.BasicKind // For enum variants Enum []int64 RawEnum []RawNumberEnumCandidate // Rust numeric type IsFloat bool IsSigned bool BitSize int IsUnsized bool // For isize/usize }
Number - numeric types in Rust
func (*Number) AddCandidates ¶ added in v0.1.2
AddCandidates adds an candidate for enum
func (*Number) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type Primitive ¶ added in v0.1.2
Primitive represents primitive types in Rust
func (*Primitive) UsedAsMapKey ¶ added in v0.1.2
type RawNumberEnumCandidate ¶
type RawNumberEnumCandidate struct { Key string Value interface{} }
RawNumberEnumCandidate represents a raw candidate for number enum
type RawStringEnumCandidate ¶
RawStringEnumCandidate represents a raw candidate for string enum
type Result ¶ added in v0.1.2
Result - Result<T, E> in Rust
func (*Result) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type Stream ¶ added in v0.1.2
Stream - stream in Rust
func (*Stream) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type String ¶
type String struct { Common Name string Enum []string // Possible enum variants RawEnum []RawStringEnumCandidate // Raw enum data with keys }
String represents a Rust String type, which can optionally be an enum
func (*String) AddCandidates ¶ added in v0.1.2
AddCandidates adds a candidate variant to the string enum
func (*String) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as a map key. Only non-enum strings can be used as map keys.
type Struct ¶ added in v0.1.2
type Struct struct { Common Name string Fields map[string]StructField }
Struct - struct in Rust
func (*Struct) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type StructField ¶ added in v0.1.2
type StructField struct { RawName string RawTag string FieldIndex int Type Type Position *token.Position Optional bool }
StructField is a field in structs
type Trait ¶ added in v0.1.2
Trait - trait in Rust
func (*Trait) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type Tuple ¶ added in v0.1.2
Tuple - tuple in Rust
func (*Tuple) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type Type ¶
type Type interface { SetPackageName(pkgName string) GetPackageName() string UsedAsMapKey() bool String() string SetPosition(pos *token.Position) GetPosition() *token.Position }
Type interface represents all Rust types handled by go-easyparser
type Unit ¶ added in v0.1.2
type Unit struct {
Common
}
Unit - unit type () in Rust
func (*Unit) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as the key for map
type Vec ¶ added in v0.1.2
Vec represents a dynamic array type in Rust (Vec<T>)
func (*Vec) UsedAsMapKey ¶ added in v0.1.2
UsedAsMapKey returns whether this type can be used as a map key. Vecs cannot be used as map keys since they don't implement Hash/Eq.