vmstate

package
v0.99.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 2 Imported by: 7

Documentation

Overview

Package vmstate contains a set of VM state flags along with appropriate type. It provides a set of conversion/marshaling functions/methods for this type as well. This package is made to make VM state reusable across all of the other components that need it without importing whole VM package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State uint8

State of the VM. It's a set of flags stored in the integer number.

const (
	// Halt represents HALT VM state (finished normally).
	Halt State = 1 << iota
	// Fault represents FAULT VM state (finished with an error).
	Fault
	// Break represents BREAK VM state (running, debug mode).
	Break
	// None represents NONE VM state (not started yet).
	None State = 0
)

Available States.

func FromString

func FromString(s string) (st State, err error)

FromString converts a string into the State.

func (State) HasFlag

func (s State) HasFlag(f State) bool

HasFlag checks for State flag presence.

func (State) MarshalJSON

func (s State) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface.

func (State) String

func (s State) String() string

String implements the fmt.Stringer interface.

func (*State) UnmarshalJSON

func (s *State) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Marshaler interface.

Jump to

Keyboard shortcuts

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