Skip to main content

rename

Function rename 

Source
pub async fn rename<P, Q>(src: P, dst: Q) -> Result<()>
where P: AsRef<Path>, Q: AsRef<Path>,
Expand description

Renames the file or directory at src to dst, replacing what is at dst if the platform allows it.

Runs std::fs::rename on the thread that polls the future.

ยงErrors

Fails, for example, if src and dst are on different filesystems.