icobject

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeBytes = TypeReserved + iota
)
View Source
const TypeReserved int = 30

Variables

View Source
var ObjectType = reflect.TypeOf((*Object)(nil))

Functions

func AttachObjectFactory

func AttachObjectFactory(database db.Database, factory ImplFactory) db.Database

func GetFromImmutableForObject

func GetFromImmutableForObject(trie trie.ImmutableForObject, key []byte) (trie.Object, error)

func GetFromMutableForObject

func GetFromMutableForObject(trie trie.MutableForObject, key []byte) (trie.Object, error)

Types

type BytesImpl

type BytesImpl []byte

func (BytesImpl) ClearCache

func (b BytesImpl) ClearCache()

func (BytesImpl) Equal

func (b BytesImpl) Equal(o Impl) bool

func (BytesImpl) Flush

func (b BytesImpl) Flush() error

func (BytesImpl) RLPDecodeFields

func (b BytesImpl) RLPDecodeFields(decoder codec.Decoder) error

func (BytesImpl) RLPEncodeFields

func (b BytesImpl) RLPEncodeFields(encoder codec.Encoder) error

func (BytesImpl) Reset

func (b BytesImpl) Reset(dbase db.Database) error

func (BytesImpl) Resolve

func (b BytesImpl) Resolve(builder merkle.Builder) error

func (BytesImpl) Version

func (b BytesImpl) Version() int

type Impl

type Impl interface {
	Version() int
	RLPDecodeFields(decoder codec.Decoder) error
	RLPEncodeFields(encoder codec.Encoder) error
	Reset(dbase db.Database) error
	Resolve(builder merkle.Builder) error
	ClearCache()
	Flush() error
	Equal(o Impl) bool
}

type ImplFactory

type ImplFactory func(tag Tag) (Impl, error)

func FactoryOf

func FactoryOf(database db.Database) ImplFactory

type NoDatabase

type NoDatabase struct{}

func (*NoDatabase) ClearCache

func (o *NoDatabase) ClearCache()

func (*NoDatabase) Flush

func (o *NoDatabase) Flush() error

func (*NoDatabase) Reset

func (o *NoDatabase) Reset(dbase db.Database) error

func (*NoDatabase) Resolve

func (o *NoDatabase) Resolve(bd merkle.Builder) error

type Object

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

func New

func New(t int, real Impl) *Object

func NewBytesObject

func NewBytesObject(bs []byte) *Object

func (*Object) Bytes

func (o *Object) Bytes() []byte

func (*Object) BytesValue

func (o *Object) BytesValue() []byte

func (*Object) ClearCache

func (o *Object) ClearCache()

func (*Object) Equal

func (o *Object) Equal(object trie.Object) bool

func (*Object) Flush

func (o *Object) Flush() error

func (*Object) Format

func (o *Object) Format(f fmt.State, c rune)

func (*Object) RLPDecodeSelf

func (o *Object) RLPDecodeSelf(d codec.Decoder, factory ImplFactory) error

func (*Object) RLPEncodeSelf

func (o *Object) RLPEncodeSelf(e codec.Encoder) error

func (*Object) Real

func (o *Object) Real() Impl

func (*Object) Reset

func (o *Object) Reset(dbase db.Database, bs []byte) error

func (*Object) Resolve

func (o *Object) Resolve(builder merkle.Builder) error

func (*Object) Tag

func (o *Object) Tag() Tag

type ObjectBigInt

type ObjectBigInt struct {
	NoDatabase
	Value *big.Int
}

func NewObjectBigInt

func NewObjectBigInt(tag Tag) *ObjectBigInt

func ToBigInt

func ToBigInt(obj trie.Object) *ObjectBigInt

func (*ObjectBigInt) Clear

func (obi *ObjectBigInt) Clear()

func (*ObjectBigInt) Equal

func (obi *ObjectBigInt) Equal(o Impl) bool

func (*ObjectBigInt) Int64

func (obi *ObjectBigInt) Int64() int64

func (*ObjectBigInt) IsEmpty

func (obi *ObjectBigInt) IsEmpty() bool

func (*ObjectBigInt) RLPDecodeFields

func (obi *ObjectBigInt) RLPDecodeFields(decoder codec.Decoder) error

func (*ObjectBigInt) RLPEncodeFields

func (obi *ObjectBigInt) RLPEncodeFields(encoder codec.Encoder) error

func (*ObjectBigInt) Version

func (obi *ObjectBigInt) Version() int

type ObjectStoreSnapshot

type ObjectStoreSnapshot struct {
	trie.ImmutableForObject
	// contains filtered or unexported fields
}

func (ObjectStoreSnapshot) BytesToObject

func (ObjectStoreSnapshot) BytesToObject(value []byte) trie.Object

func (*ObjectStoreSnapshot) Delete

func (o *ObjectStoreSnapshot) Delete(_ []byte) (trie.Object, error)

func (ObjectStoreSnapshot) ObjectToBytes

func (ObjectStoreSnapshot) ObjectToBytes(value trie.Object) []byte

func (*ObjectStoreSnapshot) Set

func (o *ObjectStoreSnapshot) Set(_ []byte, _ trie.Object) (trie.Object, error)

type ObjectStoreState

type ObjectStoreState struct {
	trie.MutableForObject
	// contains filtered or unexported fields
}

func NewObjectStoreState

func NewObjectStoreState(t trie.MutableForObject) *ObjectStoreState

func (ObjectStoreState) BytesToObject

func (ObjectStoreState) BytesToObject(value []byte) trie.Object

func (ObjectStoreState) ObjectToBytes

func (ObjectStoreState) ObjectToBytes(value trie.Object) []byte

type Tag

type Tag int

func MakeTag

func MakeTag(t int, v int) Tag

func (Tag) Type

func (t Tag) Type() int

func (Tag) Version

func (t Tag) Version() int

Jump to

Keyboard shortcuts

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