// Code generated by capnpc-go. DO NOT EDIT.

package codec

import (
	capnp "zombiezen.com/go/capnproto2"
	text "zombiezen.com/go/capnproto2/encoding/text"
	schemas "zombiezen.com/go/capnproto2/schemas"
)

type Ping struct{ capnp.Struct }

// Ping_TypeID is the unique identifier for the type Ping.
const Ping_TypeID = 0xa4c448def3da1fe5

func NewPing(s *capnp.Segment) (Ping, error) {
	st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0})
	return Ping{st}, err
}

func NewRootPing(s *capnp.Segment) (Ping, error) {
	st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0})
	return Ping{st}, err
}

func ReadRootPing(msg *capnp.Message) (Ping, error) {
	root, err := msg.RootPtr()
	return Ping{root.Struct()}, err
}

func (s Ping) String() string {
	str, _ := text.Marshal(0xa4c448def3da1fe5, s.Struct)
	return str
}

func (s Ping) Nonce() uint32 {
	return s.Struct.Uint32(0)
}

func (s Ping) SetNonce(v uint32) {
	s.Struct.SetUint32(0, v)
}

// Ping_List is a list of Ping.
type Ping_List struct{ capnp.List }

// NewPing creates a new list of Ping.
func NewPing_List(s *capnp.Segment, sz int32) (Ping_List, error) {
	l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz)
	return Ping_List{l}, err
}

func (s Ping_List) At(i int) Ping { return Ping{s.List.Struct(i)} }

func (s Ping_List) Set(i int, v Ping) error { return s.List.SetStruct(i, v.Struct) }

func (s Ping_List) String() string {
	str, _ := text.MarshalList(0xa4c448def3da1fe5, s.List)
	return str
}

// Ping_Promise is a wrapper for a Ping promised by a client call.
type Ping_Promise struct{ *capnp.Pipeline }

func (p Ping_Promise) Struct() (Ping, error) {
	s, err := p.Pipeline.Struct()
	return Ping{s}, err
}

const schema_c4411f23835fd9b0 = "x\xda2p`t`2d\xf5\xe7d`\x08\xcca" +
	"e\xfb\xffT\xfe\xd6\xe7{\x1eG\x960\x04r32" +
	"\xfe\xdfp3\xbeYY\xde\xf1\x08\x03\x0b;\x03\x83p" +
	"/K\x93\xf0D(\xcb\x9e\xe1?\x83\xfc\xff\x82\xcc\xbc" +
	"t\xbd\xe4\xc4\x02\xc6\xbc\x02\xab\x80\xcc\xbct\x86\x00F" +
	"\xc6@\x16f\x16\x06\x06\x16F\x06\x06A^#\x06\x86" +
	"@\x0ef\xc6@\x11&F\xf9\xbc\xfc\xbc\xe4TF\x0e" +
	"\x06&F\x0e\x06F@\x00\x00\x00\xff\xff\xc3\x8f\x1c\x1d"

func init() {
	schemas.Register(schema_c4411f23835fd9b0,
		0xa4c448def3da1fe5)
}
