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

package rpctwoparty

import (
	capnp "capnproto.org/go/capnp/v3"
	text "capnproto.org/go/capnp/v3/encoding/text"
	schemas "capnproto.org/go/capnp/v3/schemas"
)

type Side uint16

// Side_TypeID is the unique identifier for the type Side.
const Side_TypeID = 0x9fd69ebc87b9719c

// Values of Side.
const (
	Side_server Side = 0
	Side_client Side = 1
)

// String returns the enum's constant name.
func (c Side) String() string {
	switch c {
	case Side_server:
		return "server"
	case Side_client:
		return "client"

	default:
		return ""
	}
}

// SideFromString returns the enum value with a name,
// or the zero value if there's no such value.
func SideFromString(c string) Side {
	switch c {
	case "server":
		return Side_server
	case "client":
		return Side_client

	default:
		return 0
	}
}

type Side_List = capnp.EnumList[Side]

func NewSide_List(s *capnp.Segment, sz int32) (Side_List, error) {
	return capnp.NewEnumList[Side](s, sz)
}

type VatId capnp.Struct

// VatId_TypeID is the unique identifier for the type VatId.
const VatId_TypeID = 0xd20b909fee733a8e

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

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

func ReadRootVatId(msg *capnp.Message) (VatId, error) {
	root, err := msg.Root()
	return VatId(root.Struct()), err
}

func (s VatId) String() string {
	str, _ := text.Marshal(0xd20b909fee733a8e, capnp.Struct(s))
	return str
}

func (s VatId) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr {
	return capnp.Struct(s).EncodeAsPtr(seg)
}

func (VatId) DecodeFromPtr(p capnp.Ptr) VatId {
	return VatId(capnp.Struct{}.DecodeFromPtr(p))
}

func (s VatId) ToPtr() capnp.Ptr {
	return capnp.Struct(s).ToPtr()
}
func (s VatId) IsValid() bool {
	return capnp.Struct(s).IsValid()
}

func (s VatId) Message() *capnp.Message {
	return capnp.Struct(s).Message()
}

func (s VatId) Segment() *capnp.Segment {
	return capnp.Struct(s).Segment()
}
func (s VatId) Side() Side {
	return Side(capnp.Struct(s).Uint16(0))
}

func (s VatId) SetSide(v Side) {
	capnp.Struct(s).SetUint16(0, uint16(v))
}

// VatId_List is a list of VatId.
type VatId_List = capnp.StructList[VatId]

// NewVatId creates a new list of VatId.
func NewVatId_List(s *capnp.Segment, sz int32) (VatId_List, error) {
	l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz)
	return capnp.StructList[VatId](l), err
}

// VatId_Future is a wrapper for a VatId promised by a client call.
type VatId_Future struct{ *capnp.Future }

func (f VatId_Future) Struct() (VatId, error) {
	p, err := f.Future.Ptr()
	return VatId(p.Struct()), err
}

type ThirdPartyCompletion capnp.Struct

// ThirdPartyCompletion_TypeID is the unique identifier for the type ThirdPartyCompletion.
const ThirdPartyCompletion_TypeID = 0xb7e329e92fda637d

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

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

func ReadRootThirdPartyCompletion(msg *capnp.Message) (ThirdPartyCompletion, error) {
	root, err := msg.Root()
	return ThirdPartyCompletion(root.Struct()), err
}

func (s ThirdPartyCompletion) String() string {
	str, _ := text.Marshal(0xb7e329e92fda637d, capnp.Struct(s))
	return str
}

func (s ThirdPartyCompletion) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr {
	return capnp.Struct(s).EncodeAsPtr(seg)
}

func (ThirdPartyCompletion) DecodeFromPtr(p capnp.Ptr) ThirdPartyCompletion {
	return ThirdPartyCompletion(capnp.Struct{}.DecodeFromPtr(p))
}

func (s ThirdPartyCompletion) ToPtr() capnp.Ptr {
	return capnp.Struct(s).ToPtr()
}
func (s ThirdPartyCompletion) IsValid() bool {
	return capnp.Struct(s).IsValid()
}

func (s ThirdPartyCompletion) Message() *capnp.Message {
	return capnp.Struct(s).Message()
}

func (s ThirdPartyCompletion) Segment() *capnp.Segment {
	return capnp.Struct(s).Segment()
}
func (s ThirdPartyCompletion) JoinId() uint32 {
	return capnp.Struct(s).Uint32(0)
}

func (s ThirdPartyCompletion) SetJoinId(v uint32) {
	capnp.Struct(s).SetUint32(0, v)
}

// ThirdPartyCompletion_List is a list of ThirdPartyCompletion.
type ThirdPartyCompletion_List = capnp.StructList[ThirdPartyCompletion]

// NewThirdPartyCompletion creates a new list of ThirdPartyCompletion.
func NewThirdPartyCompletion_List(s *capnp.Segment, sz int32) (ThirdPartyCompletion_List, error) {
	l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz)
	return capnp.StructList[ThirdPartyCompletion](l), err
}

// ThirdPartyCompletion_Future is a wrapper for a ThirdPartyCompletion promised by a client call.
type ThirdPartyCompletion_Future struct{ *capnp.Future }

func (f ThirdPartyCompletion_Future) Struct() (ThirdPartyCompletion, error) {
	p, err := f.Future.Ptr()
	return ThirdPartyCompletion(p.Struct()), err
}

type ThirdPartyToAwait capnp.Struct

// ThirdPartyToAwait_TypeID is the unique identifier for the type ThirdPartyToAwait.
const ThirdPartyToAwait_TypeID = 0x9539708bffa85a5d

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

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

func ReadRootThirdPartyToAwait(msg *capnp.Message) (ThirdPartyToAwait, error) {
	root, err := msg.Root()
	return ThirdPartyToAwait(root.Struct()), err
}

func (s ThirdPartyToAwait) String() string {
	str, _ := text.Marshal(0x9539708bffa85a5d, capnp.Struct(s))
	return str
}

func (s ThirdPartyToAwait) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr {
	return capnp.Struct(s).EncodeAsPtr(seg)
}

func (ThirdPartyToAwait) DecodeFromPtr(p capnp.Ptr) ThirdPartyToAwait {
	return ThirdPartyToAwait(capnp.Struct{}.DecodeFromPtr(p))
}

func (s ThirdPartyToAwait) ToPtr() capnp.Ptr {
	return capnp.Struct(s).ToPtr()
}
func (s ThirdPartyToAwait) IsValid() bool {
	return capnp.Struct(s).IsValid()
}

func (s ThirdPartyToAwait) Message() *capnp.Message {
	return capnp.Struct(s).Message()
}

func (s ThirdPartyToAwait) Segment() *capnp.Segment {
	return capnp.Struct(s).Segment()
}

// ThirdPartyToAwait_List is a list of ThirdPartyToAwait.
type ThirdPartyToAwait_List = capnp.StructList[ThirdPartyToAwait]

// NewThirdPartyToAwait creates a new list of ThirdPartyToAwait.
func NewThirdPartyToAwait_List(s *capnp.Segment, sz int32) (ThirdPartyToAwait_List, error) {
	l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz)
	return capnp.StructList[ThirdPartyToAwait](l), err
}

// ThirdPartyToAwait_Future is a wrapper for a ThirdPartyToAwait promised by a client call.
type ThirdPartyToAwait_Future struct{ *capnp.Future }

func (f ThirdPartyToAwait_Future) Struct() (ThirdPartyToAwait, error) {
	p, err := f.Future.Ptr()
	return ThirdPartyToAwait(p.Struct()), err
}

type ThirdPartyToContact capnp.Struct

// ThirdPartyToContact_TypeID is the unique identifier for the type ThirdPartyToContact.
const ThirdPartyToContact_TypeID = 0xe8e97b3b9f049b21

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

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

func ReadRootThirdPartyToContact(msg *capnp.Message) (ThirdPartyToContact, error) {
	root, err := msg.Root()
	return ThirdPartyToContact(root.Struct()), err
}

func (s ThirdPartyToContact) String() string {
	str, _ := text.Marshal(0xe8e97b3b9f049b21, capnp.Struct(s))
	return str
}

func (s ThirdPartyToContact) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr {
	return capnp.Struct(s).EncodeAsPtr(seg)
}

func (ThirdPartyToContact) DecodeFromPtr(p capnp.Ptr) ThirdPartyToContact {
	return ThirdPartyToContact(capnp.Struct{}.DecodeFromPtr(p))
}

func (s ThirdPartyToContact) ToPtr() capnp.Ptr {
	return capnp.Struct(s).ToPtr()
}
func (s ThirdPartyToContact) IsValid() bool {
	return capnp.Struct(s).IsValid()
}

func (s ThirdPartyToContact) Message() *capnp.Message {
	return capnp.Struct(s).Message()
}

func (s ThirdPartyToContact) Segment() *capnp.Segment {
	return capnp.Struct(s).Segment()
}

// ThirdPartyToContact_List is a list of ThirdPartyToContact.
type ThirdPartyToContact_List = capnp.StructList[ThirdPartyToContact]

// NewThirdPartyToContact creates a new list of ThirdPartyToContact.
func NewThirdPartyToContact_List(s *capnp.Segment, sz int32) (ThirdPartyToContact_List, error) {
	l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz)
	return capnp.StructList[ThirdPartyToContact](l), err
}

// ThirdPartyToContact_Future is a wrapper for a ThirdPartyToContact promised by a client call.
type ThirdPartyToContact_Future struct{ *capnp.Future }

func (f ThirdPartyToContact_Future) Struct() (ThirdPartyToContact, error) {
	p, err := f.Future.Ptr()
	return ThirdPartyToContact(p.Struct()), err
}

type JoinKeyPart capnp.Struct

// JoinKeyPart_TypeID is the unique identifier for the type JoinKeyPart.
const JoinKeyPart_TypeID = 0x95b29059097fca83

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

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

func ReadRootJoinKeyPart(msg *capnp.Message) (JoinKeyPart, error) {
	root, err := msg.Root()
	return JoinKeyPart(root.Struct()), err
}

func (s JoinKeyPart) String() string {
	str, _ := text.Marshal(0x95b29059097fca83, capnp.Struct(s))
	return str
}

func (s JoinKeyPart) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr {
	return capnp.Struct(s).EncodeAsPtr(seg)
}

func (JoinKeyPart) DecodeFromPtr(p capnp.Ptr) JoinKeyPart {
	return JoinKeyPart(capnp.Struct{}.DecodeFromPtr(p))
}

func (s JoinKeyPart) ToPtr() capnp.Ptr {
	return capnp.Struct(s).ToPtr()
}
func (s JoinKeyPart) IsValid() bool {
	return capnp.Struct(s).IsValid()
}

func (s JoinKeyPart) Message() *capnp.Message {
	return capnp.Struct(s).Message()
}

func (s JoinKeyPart) Segment() *capnp.Segment {
	return capnp.Struct(s).Segment()
}
func (s JoinKeyPart) JoinId() uint32 {
	return capnp.Struct(s).Uint32(0)
}

func (s JoinKeyPart) SetJoinId(v uint32) {
	capnp.Struct(s).SetUint32(0, v)
}

func (s JoinKeyPart) PartCount() uint16 {
	return capnp.Struct(s).Uint16(4)
}

func (s JoinKeyPart) SetPartCount(v uint16) {
	capnp.Struct(s).SetUint16(4, v)
}

func (s JoinKeyPart) PartNum() uint16 {
	return capnp.Struct(s).Uint16(6)
}

func (s JoinKeyPart) SetPartNum(v uint16) {
	capnp.Struct(s).SetUint16(6, v)
}

// JoinKeyPart_List is a list of JoinKeyPart.
type JoinKeyPart_List = capnp.StructList[JoinKeyPart]

// NewJoinKeyPart creates a new list of JoinKeyPart.
func NewJoinKeyPart_List(s *capnp.Segment, sz int32) (JoinKeyPart_List, error) {
	l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz)
	return capnp.StructList[JoinKeyPart](l), err
}

// JoinKeyPart_Future is a wrapper for a JoinKeyPart promised by a client call.
type JoinKeyPart_Future struct{ *capnp.Future }

func (f JoinKeyPart_Future) Struct() (JoinKeyPart, error) {
	p, err := f.Future.Ptr()
	return JoinKeyPart(p.Struct()), err
}

type JoinResult capnp.Struct

// JoinResult_TypeID is the unique identifier for the type JoinResult.
const JoinResult_TypeID = 0x9d263a3630b7ebee

func NewJoinResult(s *capnp.Segment) (JoinResult, error) {
	st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1})
	return JoinResult(st), err
}

func NewRootJoinResult(s *capnp.Segment) (JoinResult, error) {
	st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1})
	return JoinResult(st), err
}

func ReadRootJoinResult(msg *capnp.Message) (JoinResult, error) {
	root, err := msg.Root()
	return JoinResult(root.Struct()), err
}

func (s JoinResult) String() string {
	str, _ := text.Marshal(0x9d263a3630b7ebee, capnp.Struct(s))
	return str
}

func (s JoinResult) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr {
	return capnp.Struct(s).EncodeAsPtr(seg)
}

func (JoinResult) DecodeFromPtr(p capnp.Ptr) JoinResult {
	return JoinResult(capnp.Struct{}.DecodeFromPtr(p))
}

func (s JoinResult) ToPtr() capnp.Ptr {
	return capnp.Struct(s).ToPtr()
}
func (s JoinResult) IsValid() bool {
	return capnp.Struct(s).IsValid()
}

func (s JoinResult) Message() *capnp.Message {
	return capnp.Struct(s).Message()
}

func (s JoinResult) Segment() *capnp.Segment {
	return capnp.Struct(s).Segment()
}
func (s JoinResult) JoinId() uint32 {
	return capnp.Struct(s).Uint32(0)
}

func (s JoinResult) SetJoinId(v uint32) {
	capnp.Struct(s).SetUint32(0, v)
}

func (s JoinResult) Succeeded() bool {
	return capnp.Struct(s).Bit(32)
}

func (s JoinResult) SetSucceeded(v bool) {
	capnp.Struct(s).SetBit(32, v)
}

func (s JoinResult) Cap() capnp.Client {
	p, _ := capnp.Struct(s).Ptr(0)
	return p.Interface().Client()
}

func (s JoinResult) HasCap() bool {
	return capnp.Struct(s).HasPtr(0)
}

func (s JoinResult) SetCap(c capnp.Client) error {
	if !c.IsValid() {
		return capnp.Struct(s).SetPtr(0, capnp.Ptr{})
	}
	seg := s.Segment()
	in := capnp.NewInterface(seg, seg.Message().CapTable().Add(c))
	return capnp.Struct(s).SetPtr(0, in.ToPtr())
}

// JoinResult_List is a list of JoinResult.
type JoinResult_List = capnp.StructList[JoinResult]

// NewJoinResult creates a new list of JoinResult.
func NewJoinResult_List(s *capnp.Segment, sz int32) (JoinResult_List, error) {
	l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz)
	return capnp.StructList[JoinResult](l), err
}

// JoinResult_Future is a wrapper for a JoinResult promised by a client call.
type JoinResult_Future struct{ *capnp.Future }

func (f JoinResult_Future) Struct() (JoinResult, error) {
	p, err := f.Future.Ptr()
	return JoinResult(p.Struct()), err
}
func (p JoinResult_Future) Cap() capnp.Client {
	return p.Future.Field(0, nil).Client()
}

const schema_a184c7885cdaf2a1 = "x\xda|\x92=h\x14]\x14\x86\xcf{\xef\xe4\x9b\x0d" +
	"\x9fa\x99\xdcm,\xc4\x1fP0\xa0F\xe2\x0f\x8e\xc5" +
	"$Y\x02\xae\x06\xd9\x89\x8b\x181\xc50s\xc1\x91\xdd" +
	"\x99\xc9\xec\xac!\x88l\xa1\xa0 J\x9a-\xc4\x9f%" +
	"\x9d\x9d \x84 h\xa1 BJ\x0b\x8b\xb46\x06!" +
	"EJ\x9b\x91;\xe0n\xd8\xec\xda\xcd\x1c\x9e\xfb\xde\xe7" +
	"\x9c{\xc6\xa70\xa9\x9d\x1eij\xc4\xec3C\xff\xa5" +
	"\x0b7\xdf\xa4O\xa2\x0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x87\xb5\xbeOR\x0ck" +
	"QU&~\x18daZ\xa7\xb5\x11\xd5Z\x8e\xc3." +
	"\xec5\xee\xe7s\xddIJ\x1e\xf5\x86\x8cuC\xf2u" +
	"\xdf\x93\xc8wW\x99\x80\xfc\xae\xb0A+S\xb4\xc2 " +
	"q\\5\xf9?\x01\x00\x00\xff\xff\x9e\xc7\xfb\x05"

func RegisterSchema(reg *schemas.Registry) {
	reg.Register(&schemas.Schema{
		String: schema_a184c7885cdaf2a1,
		Nodes: []uint64{
			0x9539708bffa85a5d,
			0x95b29059097fca83,
			0x9d263a3630b7ebee,
			0x9fd69ebc87b9719c,
			0xb7e329e92fda637d,
			0xd20b909fee733a8e,
			0xe8e97b3b9f049b21,
		},
		Compressed: true,
	})
}
