2024-11-20 12:34:24 +01:00
|
|
|
package args
|
|
|
|
|
|
2024-11-20 18:27:01 +01:00
|
|
|
import (
|
|
|
|
|
"iter"
|
|
|
|
|
|
|
|
|
|
"github.com/ipld/go-ipld-prime"
|
|
|
|
|
)
|
2024-11-20 12:34:24 +01:00
|
|
|
|
|
|
|
|
type ReadOnly struct {
|
|
|
|
|
args *Args
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-27 12:23:10 +01:00
|
|
|
func (r ReadOnly) GetNode(key string) (ipld.Node, error) {
|
|
|
|
|
return r.args.GetNode(key)
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-12 16:06:01 +01:00
|
|
|
func (r ReadOnly) Len() int {
|
|
|
|
|
return r.args.Len()
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-20 18:27:01 +01:00
|
|
|
func (r ReadOnly) Iter() iter.Seq2[string, ipld.Node] {
|
|
|
|
|
return r.args.Iter()
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-20 12:34:24 +01:00
|
|
|
func (r ReadOnly) ToIPLD() (ipld.Node, error) {
|
|
|
|
|
return r.args.ToIPLD()
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-20 18:27:01 +01:00
|
|
|
func (r ReadOnly) Equals(other ReadOnly) bool {
|
|
|
|
|
return r.args.Equals(other.args)
|
2024-11-20 12:34:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (r ReadOnly) String() string {
|
|
|
|
|
return r.args.String()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (r ReadOnly) WriteableClone() *Args {
|
|
|
|
|
return r.args.Clone()
|
|
|
|
|
}
|