// CopyTo copies the current context store into a new Context.
554923
func (c *Context) CopyTo(newCtx *Context) {
	store := Store{}

	for key, value := range c.getStore() {
		store[key] = value
	}

	ctx := context.WithValue(context.Background(), Key, store)
	newCtx.Request = newCtx.Request.WithContext(ctx)
}
549707
func (o *ReplicationControllerOptions) ApplyTo(cfg *replicationconfig.ReplicationControllerConfiguration) error {
	if o == nil {
		return nil
	}

	cfg.ConcurrentRCSyncs = o.ConcurrentRCSyncs

	return nil
}
144489
func (container *Container) CheckpointTo(store ViewDB) error {
	deepCopy, err := container.toDisk()
	if err != nil {
		return err
	}
	return store.Save(deepCopy)
}
1208646
func (f *File) WriteTo(w io.Writer) (int64, error) {
	return f.WriteToIndent(w, "")
}
831337
func (r *Reader) WriteTo(w io.Writer) (int64, error) {
	var (
		i   int64
		ii  int
		err error
	)
	// first, clear buffer
	if r.buffered() > 0 {
		ii, err = w.Write(r.data[r.n:])
		i += int64(ii)
		if err != nil {
			return i, err
		}
		r.data = r.data[0:0]
		r.n = 0
	}
	for r.state == nil {
		// here we just do
		// 1:1 reads and writes
		r.more()
		if r.buffered() > 0 {
			ii, err = w.Write(r.data)
			i += int64(ii)
			if err != nil {
				return i, err
			}
			r.data = r.data[0:0]
			r.n = 0
		}
	}
	if r.state != io.EOF {
		return i, r.err()
	}
	return i, nil
}
984393
func (dc *DeepCopier) To(dst interface{}) error {
	dc.dst = dst
	return process(dc.dst, dc.src, Options{Context: dc.ctx})
}
389794
func (b *ByteBuffer) WriteTo(w io.Writer) (int64, error) {
	n, err := w.Write(b.B)
	return int64(n), err
}
767582
func Copy(ctx context.Context, c *cli.Context, store storer) error {
	from := c.Args().Get(0)
	to := c.Args().Get(1)

	// argument checking is in s.binaryCopy
	if err := binaryCopy(ctx, c, from, to, false, store); err != nil {
		return action.ExitError(ctx, action.ExitUnknown, err, "%s", err)
	}
	return nil
}
1143781
func (d *Context) Copy(fromIndex int, toIndex int) {
	C.duk_copy(d.duk_context, C.duk_idx_t(fromIndex), C.duk_idx_t(toIndex))
}
728914
func (ini *INI) WriteTo(w io.Writer) (int64, error) {
	var written int64

	// Global section.
	m, err := ini.printSection(w, &ini.global)
	written += int64(m)
	if err != nil {
		return written, err
	}
	first := len(ini.global.Data) > 0

	for i, section := range ini.sections {
		if i > 0 || first {
			m, err := fmt.Fprintf(w, "\n")
			written += int64(m)
			if err != nil {
				return written, err
			}
		}
		m, err := ini.printSection(w, section)
		written += int64(m)
		if err != nil {
			return written, err
		}
	}

	return written, nil
}
356400
func (q *Query) CopyTo(w io.Writer, query interface{}, params ...interface{}) (Result, error) {
	params = append(params, q.model)
	return q.db.CopyTo(w, query, params...)
}
40067
func (sm *SM) SerializeTo(w io.Writer) error {
	_, err := w.Write(sm.Bytes())
	return err
}
444853
func (d *Description) copyTo(s string, length int) []byte {
	b := make([]byte, length)
	copy(b, []byte(s))
	return b
}
1104093
func (qc *QueryContext) Copy() *QueryContext {
	if qc == nil {
		return nil
	}
	cpy := *qc
	if cpy.Package != nil {
		cpy.Package = qc.Package.Copy()
	}
	cpy.Imports = make([]*Import, len(qc.Imports))
	for i := range qc.Imports {
		cpy.Imports[i] = qc.Imports[i].Copy()
	}
	return &cpy
}
550884
func (s *Store) WriteTo(w io.Writer) (n int64, err error) {
	s.mtx.RLock()
	defer s.mtx.RUnlock()

	return s.writeTo(w)
}
448086
func (header *Header) WriteTo(w io.Writer) (int64, error) {
	switch header.Version {
	case 1:
		return header.writeVersion1(w)
	case 2:
		return header.writeVersion2(w)
	default:
		return 0, ErrUnknownProxyProtocolVersion
	}
}
1360615
func (r *AccessLogRecord) WriteTo(w io.Writer) (int64, error) {
	bytesWritten, err := w.Write(r.getRecord())
	return int64(bytesWritten), err
}