Function typed_path::utils::utf8_current_exe

source ·
pub fn utf8_current_exe() -> Result<Utf8NativePathBuf>
Expand description

Returns the full filesystem path of the current running executable as Utf8NativePathBuf.

§Errors

Returns an Err if unable to parse the path with the native encoding or the path was not valid UTF8.

Additionally, returns a Err if, as env::current_exe states, a related filesystem operation or syscall fails.

§Examples

fn main() -> std::io::Result<()> {
    let path = typed_path::utils::utf8_current_exe()?;
    println!("The current executable path is {}", path);
    Ok(())
}