add

package
v0.0.0-...-50e87c1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrArithmeticErrorIntegerOverflow = fmt.Errorf("ArithmeticErrorIntegerOverflow")

Err* are used for checking error type with `errors.Is`

View Source
var FfiConverterBoolINSTANCE = FfiConverterBool{}
View Source
var FfiConverterStringINSTANCE = FfiConverterString{}
View Source
var FfiConverterTypeArithmeticErrorINSTANCE = FfiConverterTypeArithmeticError{}
View Source
var FfiConverterUint64INSTANCE = FfiConverterUint64{}

Functions

func Add

func Add(a uint64, b uint64) (uint64, error)

func Div

func Div(dividend uint64, divisor uint64) uint64

func Equal

func Equal(a uint64, b uint64) bool

func LiftFromRustBuffer

func LiftFromRustBuffer[GoType any](bufReader BufReader[GoType], rbuf RustBufferI) GoType

func Sub

func Sub(a uint64, b uint64) (uint64, error)

Types

type ArithmeticError

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

func NewArithmeticErrorIntegerOverflow

func NewArithmeticErrorIntegerOverflow() *ArithmeticError

func (ArithmeticError) Error

func (err ArithmeticError) Error() string

func (ArithmeticError) Unwrap

func (err ArithmeticError) Unwrap() error

type ArithmeticErrorIntegerOverflow

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

Variant structs

func (ArithmeticErrorIntegerOverflow) Error

func (ArithmeticErrorIntegerOverflow) Is

func (self ArithmeticErrorIntegerOverflow) Is(target error) bool

type BufLifter

type BufLifter[GoType any] interface {
	Lift(value RustBufferI) GoType
}

type BufLowerer

type BufLowerer[GoType any] interface {
	Lower(value GoType) RustBuffer
}

type BufReader

type BufReader[GoType any] interface {
	Read(reader io.Reader) GoType
}

type BufWriter

type BufWriter[GoType any] interface {
	Write(writer io.Writer, value GoType)
}

type FfiConverter

type FfiConverter[GoType any, FfiType any] interface {
	Lift(value FfiType) GoType
	Lower(value GoType) FfiType
}

type FfiConverterBool

type FfiConverterBool struct{}

func (FfiConverterBool) Lift

func (FfiConverterBool) Lift(value C.int8_t) bool

func (FfiConverterBool) Lower

func (FfiConverterBool) Lower(value bool) C.int8_t

func (FfiConverterBool) Read

func (FfiConverterBool) Read(reader io.Reader) bool

func (FfiConverterBool) Write

func (FfiConverterBool) Write(writer io.Writer, value bool)

type FfiConverterString

type FfiConverterString struct{}

func (FfiConverterString) Lift

func (FfiConverterString) Lower

func (FfiConverterString) Lower(value string) RustBuffer

func (FfiConverterString) Read

func (FfiConverterString) Read(reader io.Reader) string

func (FfiConverterString) Write

func (FfiConverterString) Write(writer io.Writer, value string)

type FfiConverterTypeArithmeticError

type FfiConverterTypeArithmeticError struct{}

func (FfiConverterTypeArithmeticError) Lift

func (FfiConverterTypeArithmeticError) Lower

func (FfiConverterTypeArithmeticError) Read

func (FfiConverterTypeArithmeticError) Write

func (c FfiConverterTypeArithmeticError) Write(writer io.Writer, value *ArithmeticError)

type FfiConverterUint64

type FfiConverterUint64 struct{}

func (FfiConverterUint64) Lift

func (FfiConverterUint64) Lift(value C.uint64_t) uint64

func (FfiConverterUint64) Lower

func (FfiConverterUint64) Lower(value uint64) C.uint64_t

func (FfiConverterUint64) Read

func (FfiConverterUint64) Read(reader io.Reader) uint64

func (FfiConverterUint64) Write

func (FfiConverterUint64) Write(writer io.Writer, value uint64)

type FfiDestroyerBool

type FfiDestroyerBool struct{}

func (FfiDestroyerBool) Destroy

func (FfiDestroyerBool) Destroy(_ bool)

type FfiDestroyerString

type FfiDestroyerString struct{}

func (FfiDestroyerString) Destroy

func (FfiDestroyerString) Destroy(_ string)

type FfiDestroyerUint64

type FfiDestroyerUint64 struct{}

func (FfiDestroyerUint64) Destroy

func (FfiDestroyerUint64) Destroy(_ uint64)

type FfiRustBufConverter

type FfiRustBufConverter[GoType any, FfiType any] interface {
	FfiConverter[GoType, FfiType]
	BufReader[GoType]
}

type RustBuffer

type RustBuffer = C.RustBuffer

func LowerIntoRustBuffer

func LowerIntoRustBuffer[GoType any](bufWriter BufWriter[GoType], value GoType) RustBuffer

func RustBufferFromExternal

func RustBufferFromExternal(b RustBufferI) RustBuffer

func (RustBuffer) AsReader

func (cb RustBuffer) AsReader() *bytes.Reader

func (RustBuffer) Capacity

func (cb RustBuffer) Capacity() int

func (RustBuffer) Data

func (cb RustBuffer) Data() unsafe.Pointer

func (RustBuffer) Free

func (cb RustBuffer) Free()

func (RustBuffer) Len

func (cb RustBuffer) Len() int

func (RustBuffer) ToGoBytes

func (cb RustBuffer) ToGoBytes() []byte

type RustBufferI

type RustBufferI interface {
	AsReader() *bytes.Reader
	Free()
	ToGoBytes() []byte
	Data() unsafe.Pointer
	Len() int
	Capacity() int
}

Jump to

Keyboard shortcuts

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