pub struct Asset(/* private fields */);Implementations§
Source§impl Asset
impl Asset
pub fn new(path: String) -> Self
Sourcepub fn rename(&self, new_path: String)
pub fn rename(&self, new_path: String)
Rename the provided asset. First checks for a file and if not a file found checks for a directory.
§Arguments
&self- self asset object reference.new_path- the new named asset, should not be empty.
§Panics
If an empty string name is provided function will panic. If you try to rename a directory with file path or viceversa.
§Example
use rnm::Asset;
// Simulate creating a new asset instance for a file
let file_path = Asset::new(String::from("hello.txt"));
file_path.rename(String::from("bye.txt"));
Auto Trait Implementations§
impl Freeze for Asset
impl RefUnwindSafe for Asset
impl Send for Asset
impl Sync for Asset
impl Unpin for Asset
impl UnwindSafe for Asset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more