// automatically generated by stateify.

package buffer

import (
	"gvisor.dev/gvisor/pkg/state"
)

func (x *buffer) StateTypeName() string {
	return "pkg/buffer.buffer"
}

func (x *buffer) StateFields() []string {
	return []string{
		"data",
		"read",
		"write",
		"bufferEntry",
	}
}

func (x *buffer) beforeSave() {}

func (x *buffer) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.data)
	m.Save(1, &x.read)
	m.Save(2, &x.write)
	m.Save(3, &x.bufferEntry)
}

func (x *buffer) afterLoad() {}

func (x *buffer) StateLoad(m state.Source) {
	m.Load(0, &x.data)
	m.Load(1, &x.read)
	m.Load(2, &x.write)
	m.Load(3, &x.bufferEntry)
}

func (x *bufferList) StateTypeName() string {
	return "pkg/buffer.bufferList"
}

func (x *bufferList) StateFields() []string {
	return []string{
		"head",
		"tail",
	}
}

func (x *bufferList) beforeSave() {}

func (x *bufferList) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.head)
	m.Save(1, &x.tail)
}

func (x *bufferList) afterLoad() {}

func (x *bufferList) StateLoad(m state.Source) {
	m.Load(0, &x.head)
	m.Load(1, &x.tail)
}

func (x *bufferEntry) StateTypeName() string {
	return "pkg/buffer.bufferEntry"
}

func (x *bufferEntry) StateFields() []string {
	return []string{
		"next",
		"prev",
	}
}

func (x *bufferEntry) beforeSave() {}

func (x *bufferEntry) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.next)
	m.Save(1, &x.prev)
}

func (x *bufferEntry) afterLoad() {}

func (x *bufferEntry) StateLoad(m state.Source) {
	m.Load(0, &x.next)
	m.Load(1, &x.prev)
}

func (x *View) StateTypeName() string {
	return "pkg/buffer.View"
}

func (x *View) StateFields() []string {
	return []string{
		"data",
		"size",
	}
}

func (x *View) beforeSave() {}

func (x *View) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.data)
	m.Save(1, &x.size)
}

func (x *View) afterLoad() {}

func (x *View) StateLoad(m state.Source) {
	m.Load(0, &x.data)
	m.Load(1, &x.size)
}

func init() {
	state.Register((*buffer)(nil))
	state.Register((*bufferList)(nil))
	state.Register((*bufferEntry)(nil))
	state.Register((*View)(nil))
}