Skip to main content

FileRenameHook

Type Alias FileRenameHook 

Source
pub type FileRenameHook = fn(from: &[u8], to: &[u8]) -> Result<(), LuaError>;
Expand description

Function-pointer signature for renaming a file, installed on GlobalState::file_rename_hook by the embedder.

std::fs is banned outside lua-cli, so lua-stdlib’s os.rename reaches the filesystem via this hook. Returns Ok(()) on success.