df-helper 0.2.26

df helper tools db cache
Documentation
use std::path::PathBuf;
use uuid::Uuid;

/// 获取当前项目根目录
pub fn root_path() -> String {
    let root_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
    let root_path = root_path.to_str().unwrap();
    root_path.to_string()
}

/// 生成UUID
pub fn uuid() -> String {
    let my_uuid = Uuid::new_v4();
    return my_uuid.to_string();
}

/// 获取本地ip地址
pub fn local_ip() -> String {
    return local_ipaddress::get().unwrap();
}