github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/vm/stackitem/immutable.go (about)

     1  package stackitem
     2  
     3  type ro struct {
     4  	isReadOnly bool
     5  }
     6  
     7  // IsReadOnly implements Immutable interface.
     8  func (r *ro) IsReadOnly() bool {
     9  	return r.isReadOnly
    10  }
    11  
    12  // MarkAsReadOnly implements immutable interface.
    13  func (r *ro) MarkAsReadOnly() {
    14  	r.isReadOnly = true
    15  }
    16  
    17  // Immutable is an interface supported by compound types (Array, Map, Struct).
    18  type Immutable interface {
    19  	IsReadOnly() bool
    20  	MarkAsReadOnly()
    21  }