pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> Result<()>
Rename a file or directory to a new name.
This will not work if the new name is on a different mount point.
This function will return an error if the provided
from doesn't exist, if
the process lacks permissions to view the contents, if
reside on separate filesystems, or if some other intermittent I/O error
use std::fs; try!(fs::rename("a.txt", "b.txt"));