mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-17 19:47:19 +00:00
22 lines
410 B
Go
22 lines
410 B
Go
|
package stackitem
|
||
|
|
||
|
type ro struct {
|
||
|
isReadOnly bool
|
||
|
}
|
||
|
|
||
|
// IsReadOnly implements Immutable interface.
|
||
|
func (r *ro) IsReadOnly() bool {
|
||
|
return r.isReadOnly
|
||
|
}
|
||
|
|
||
|
// MarkAsReadOnly implements immutable interface.
|
||
|
func (r *ro) MarkAsReadOnly() {
|
||
|
r.isReadOnly = true
|
||
|
}
|
||
|
|
||
|
// Immutable is an interface supported by compound types (Array, Map, Struct).
|
||
|
type Immutable interface {
|
||
|
IsReadOnly() bool
|
||
|
MarkAsReadOnly()
|
||
|
}
|