bindings

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package bindings provides abstractions shared by all bindings generators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFuncs

func BuildFuncs[T any](pkg *ir.Package, factory func(ir.Func, int) (*T, error)) ([]*T, error)

BuildFuncs collects all the functions of a package for which bindings are generated.

func CanBeOnDevice

func CanBeOnDevice(tp ir.Type) error

CanBeOnDevice returns true if a type can be on device.

func CanBeOnDeviceFunc

func CanBeOnDeviceFunc(gxFunc ir.Func) bool

CanBeOnDeviceFunc returns true if a function can be implemented on a device.

func IsDefaultInt

func IsDefaultInt(kind ir.Kind) bool

IsDefaultInt returns true if the kind can be converted to the system default integer type.

Types

type Binder

type Binder interface {
	Files() []File
}

Binder writes the bindings for a specific language.

type File

type File interface {
	// BuildFilePath builds the file path of the file given
	// a root folder and a GX package.
	BuildFilePath(root string, pkg *ir.Package) string

	// WriteBindings the content of the file.
	WriteBindings(io.Writer) error
}

File generated by the binder.

type New

type New func(*ir.Package) (Binder, error)

New returns a new binder.

Jump to

Keyboard shortcuts

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