scie_model 0.1.0

Scie is a research about how to build simple code identify engine for different languages.
Documentation
use crate::artifact::Element;
use std::path::PathBuf;

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct CodeFile {
    pub path: String,
    pub name: String,
    pub elements: Vec<Element>,
}

impl CodeFile {
    pub fn new(path: PathBuf) -> CodeFile {
        let name = path.file_name().unwrap().to_str().unwrap();
        CodeFile {
            path: path.display().to_string(),
            name: String::from(name),
            elements: vec![],
        }
    }
}