callback

package
v0.93.0-pre Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ic *interop.Context) error

Create creates callback using pointer and parameters count.

func CreateFromMethod

func CreateFromMethod(ic *interop.Context) error

CreateFromMethod creates callback for a contract method.

func CreateFromSyscall

func CreateFromSyscall(ic *interop.Context) error

CreateFromSyscall creates callback from syscall.

func Invoke

func Invoke(ic *interop.Context) error

Invoke invokes provided callback.

Types

type Callback

type Callback interface {
	// ArgCount returns expected number of arguments.
	ArgCount() int
	// LoadContext loads context and arguments on stack.
	LoadContext(*vm.VM, []stackitem.Item)
}

Callback is an interface for arbitrary callbacks.

type MethodCallback

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

MethodCallback represents callback for contract method.

func (*MethodCallback) ArgCount

func (s *MethodCallback) ArgCount() int

ArgCount implements Callback interface.

func (*MethodCallback) LoadContext

func (s *MethodCallback) LoadContext(v *vm.VM, args []stackitem.Item)

LoadContext implements Callback interface.

type PointerCallback

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

PointerCallback represents callback for a pointer.

func (*PointerCallback) ArgCount

func (p *PointerCallback) ArgCount() int

ArgCount implements Callback interface.

func (*PointerCallback) LoadContext

func (p *PointerCallback) LoadContext(v *vm.VM, args []stackitem.Item)

LoadContext implements Callback interface.

type SyscallCallback

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

SyscallCallback represents callback for a syscall.

func (*SyscallCallback) ArgCount

func (p *SyscallCallback) ArgCount() int

ArgCount implements Callback interface.

func (*SyscallCallback) LoadContext

func (p *SyscallCallback) LoadContext(v *vm.VM, args []stackitem.Item)

LoadContext implements Callback interface.

Jump to

Keyboard shortcuts

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