// CopyTo deep copies the handle into the passed destination object
483560
func (h *Handle) CopyTo(o datastore.KVObject) error {
	h.Lock()
	defer h.Unlock()

	dstH := o.(*Handle)
	if h == dstH {
		return nil
	}
	dstH.Lock()
	dstH.bits = h.bits
	dstH.unselected = h.unselected
	dstH.head = h.head.getCopy()
	dstH.app = h.app
	dstH.id = h.id
	dstH.dbIndex = h.dbIndex
	dstH.dbExists = h.dbExists
	dstH.store = h.store
	dstH.curr = h.curr
	dstH.Unlock()

	return nil
}
249124
func (t *TablePropApplySetField) WriteTo(w io.Writer) (int64, error) {
	return writeTablePropXM(w, t, t.Fields)
}
1106630
func (s String) WriteTo(w Writer) error {
	return ByteSlice(s).WriteTo(w)
}
202996
func (a *ActionSetQueue) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, action{a.Type(), actionLen}, a.QueueID)
}
437760
func (p *Namespaces) CloneTo(p2 *Namespaces) {
	if p == p2 {
		return
	}
	if !p.Safe {
		p.mu.RLock()
		defer p.mu.RUnlock()
	}
	if !p2.Safe {
		p2.mu.Lock()
		defer p2.mu.Unlock()
	}
	if p2.prefixes == nil {
		p2.prefixes = make(map[string]string, len(p.prefixes))
	}
	for pref, ns := range p.prefixes {
		p2.prefixes[pref] = ns
	}
}
282152
func (b *Bar) WriteTo(w io.Writer) (int64, error) {
	s := fmt.Sprintf("\r   %s ", b.String())
	_, err := io.WriteString(w, s)
	return int64(len(s)), err
}
156005
func (tx *Tx) Copy(w io.Writer) error {
	_, err := tx.WriteTo(w)
	return err
}
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
	}
}
262360
func (h *Handlers) Copy() Handlers {
	return Handlers{
		Validate:         h.Validate.copy(),
		Build:            h.Build.copy(),
		Sign:             h.Sign.copy(),
		Send:             h.Send.copy(),
		ValidateResponse: h.ValidateResponse.copy(),
		Unmarshal:        h.Unmarshal.copy(),
		UnmarshalStream:  h.UnmarshalStream.copy(),
		UnmarshalError:   h.UnmarshalError.copy(),
		UnmarshalMeta:    h.UnmarshalMeta.copy(),
		Retry:            h.Retry.copy(),
		AfterRetry:       h.AfterRetry.copy(),
		CompleteAttempt:  h.CompleteAttempt.copy(),
		Complete:         h.Complete.copy(),
	}
}
444658
func (c *IpamConf) CopyTo(dstC *IpamConf) error {
	dstC.PreferredPool = c.PreferredPool
	dstC.SubPool = c.SubPool
	dstC.Gateway = c.Gateway
	if c.AuxAddresses != nil {
		dstC.AuxAddresses = make(map[string]string, len(c.AuxAddresses))
		for k, v := range c.AuxAddresses {
			dstC.AuxAddresses[k] = v
		}
	}
	return nil
}
1028213
func (a *ActionSetField) WriteTo(w io.Writer) (int64, error) {
	var buf bytes.Buffer

	_, err := a.Field.WriteTo(&buf)
	if err != nil {
		return 0, err
	}

	// Length is padded to 64 bits
	length := buf.Len() + 4

	if length%8 != 0 {
		_, err := buf.Write(make(pad, 8-length%8))
		if err != nil {
			return 0, err
		}
	}

	header := action{a.Type(), uint16(buf.Len() + 4)}
	return encoding.WriteTo(w, header, buf.Bytes())
}
1211026
func (c *Client) WriteTo(p *Packet, addr net.HardwareAddr) error {
	pb, err := p.MarshalBinary()
	if err != nil {
		return err
	}

	f := &ethernet.Frame{
		Destination: p.TargetHardwareAddr,
		Source:      p.SenderHardwareAddr,
		EtherType:   ethernet.EtherTypeARP,
		Payload:     pb,
	}

	fb, err := f.MarshalBinary()
	if err != nil {
		return err
	}

	_, err = c.p.WriteTo(fb, &raw.Addr{HardwareAddr: addr})
	return err
}
141168
func (r Rope) WriteTo(w io.Writer) (n int64, err error) {
	if r.node == nil {
		return 0, nil // Nothing to do
	}
	return r.node.WriteTo(w)
}
1094927
func (r *Runtime) ExportTo(v Value, target interface{}) error {
	tval := reflect.ValueOf(target)
	if tval.Kind() != reflect.Ptr || tval.IsNil() {
		return errors.New("target must be a non-nil pointer")
	}
	vv, err := r.toReflectValue(v, tval.Elem().Type())
	if err != nil {
		return err
	}
	tval.Elem().Set(vv)
	return nil
}
581282
func (v *variable) WriteTo(w io.Writer) (int64, error) {
	n, err := w.Write([]byte(v.value))

	return int64(n), err
}
860708
func (b Bool) WriteTo(w io.Writer) (int64, error) {
	written, err := fmt.Fprintf(w, "%t", b)
	return int64(written), err
}
1121858
func (m *MultipartReply) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, *m, pad4{})
}