// Copy copies the EphemeralDisk struct and returns a new one
326521
func (d *EphemeralDisk) Copy() *EphemeralDisk {
	ld := new(EphemeralDisk)
	*ld = *d
	return ld
}
1040683
func Copy(src, dst fs.Filesystem, from, to string) (err error) {
	return withPreparedTarget(dst, from, to, func() error {
		return copyFileContents(src, dst, from, to)
	})
}
173914
func (renderer *Renderer) Copy(texture *Texture, src, dst *Rect) error {
	return errorFromInt(int(
		C.SDL_RenderCopy(
			renderer.cptr(),
			texture.cptr(),
			src.cptr(),
			dst.cptr())))
}
504381
func (r *ResourceLifecycle) Copy() *ResourceLifecycle {
	n := &ResourceLifecycle{
		CreateBeforeDestroy: r.CreateBeforeDestroy,
		PreventDestroy:      r.PreventDestroy,
		IgnoreChanges:       make([]string, len(r.IgnoreChanges)),
	}
	copy(n.IgnoreChanges, r.IgnoreChanges)
	return n
}
1184269
func (rdh *RawDefaultHash) Copy() *RawDefaultHash {
	if rdh == nil {
		return nil
	}
	hashCopy := RawDefaultHash{}
	copy(hashCopy[:], rdh[:])
	return &hashCopy
}
703868
func (c *SyncCollector) Copy(m map[string]interface{}) {
	for v, k := range m {
		c.Set(v, k)
	}
}
970050
func (m Map) Copy() Map {
	cpy := make(Map, len(m))
	for k, vs := range m {
		cpy[k] = append([]string(nil), vs...)
	}
	return cpy
}
74277
func Copy(src PackedIntsReader, srcPos int, dest Mutable, destPos, length, mem int) {
	assert(srcPos+length <= int(src.Size()))
	assert(destPos+length <= int(dest.Size()))
	capacity := int(uint(mem) >> 3)
	if capacity == 0 {
		panic("niy")
	} else if length > 0 {
		// use bulk operations
		if length < capacity {
			capacity = length
		}
		buf := make([]int64, capacity)
		copyWith(src, srcPos, dest, destPos, length, buf)
	}
}
81454
func (a Args) Copy() Args {
	cpy := Args{}
	for _, t := range a {
		cpy = append(cpy, t.Copy())
	}
	return cpy
}
1140549
func (s *State) Copy() *State {
	taskStates := make(map[string]*structs.TaskState, len(s.TaskStates))
	for k, v := range s.TaskStates {
		taskStates[k] = v.Copy()
	}
	return &State{
		ClientStatus:      s.ClientStatus,
		ClientDescription: s.ClientDescription,
		DeploymentStatus:  s.DeploymentStatus.Copy(),
		TaskStates:        taskStates,
	}
}
837323
func (f *File) Copy() (*File, error) {
	var datacopy = make([]byte, len(f.data))
	copy(datacopy[:], f.data)
	return &File{
		name:     f.name,
		filemode: f.filemode,
		time:     f.time,
		data:     datacopy,
	}, nil
}
1223286
func (x Vector) Copy() Vector {
	y := make(Vector, len(x))
	copy(y, x)
	return y
}
1120530
func Copy(src, dest string) error {
	// Gather file information to set back later.
	si, err := os.Lstat(src)
	if err != nil {
		return err
	}

	// Handle symbolic link.
	if si.Mode()&os.ModeSymlink != 0 {
		target, err := os.Readlink(src)
		if err != nil {
			return err
		}
		// NOTE: os.Chmod and os.Chtimes don't recoganize symbolic link,
		// which will lead "no such file or directory" error.
		return os.Symlink(target, dest)
	}

	sr, err := os.Open(src)
	if err != nil {
		return err
	}
	defer sr.Close()

	dw, err := os.Create(dest)
	if err != nil {
		return err
	}
	defer dw.Close()

	if _, err = io.Copy(dw, sr); err != nil {
		return err
	}

	// Set back file information.
	if err = os.Chtimes(dest, si.ModTime(), si.ModTime()); err != nil {
		return err
	}
	return os.Chmod(dest, si.Mode())
}
984018
func (s *Node) Copy() *Node {
	localCopy := deepcopy.Copy(*s)
	nodeCopy := localCopy.(Node)
	return &nodeCopy
}
1309151
func (s *ConfigSnapshot) Clone() (*ConfigSnapshot, error) {
	snapCopy, err := copystructure.Copy(s)
	if err != nil {
		return nil, err
	}
	return snapCopy.(*ConfigSnapshot), nil
}
665497
func (s *State) Copy(db dbm.DB) (*State, error) {
	stateCopy := NewState(db)
	err := s.writeState.forest.IterateRWTree(nil, nil, true,
		func(prefix []byte, tree *storage.RWTree) error {
			treeCopy, err := stateCopy.writeState.forest.Writer(prefix)
			if err != nil {
				return err
			}
			return tree.IterateWriteTree(nil, nil, true, func(key []byte, value []byte) error {
				treeCopy.Set(key, value)
				return nil
			})
		})
	if err != nil {
		return nil, err
	}
	_, _, err = stateCopy.commit()
	if err != nil {
		return nil, err
	}
	return stateCopy, nil
}
639666
func (r *Store) Copy(ctx context.Context, from, to string) error {
	return r.move(ctx, from, to, false)
}