Struct nya::SimpleFile[][src]

pub struct SimpleFile {
    pub name: OsString,
    pub content: String,
    pub abs_path: PathBuf,
    pub rel_path: PathBuf,
    pub metadata: HashMap<&'static str, String>,
}

A struct describing a simple file, with only a name, content, path (relative & absolute), and custom metadata.

Examples

let file = nya::SimpleFile {
    name: std::ffi::OsString::from("coolfile.txt"),
    content: "hello".to_string(),
    abs_path: std::path::PathBuf::from(r"/home/coolfile.txt"),
    rel_path: std::path::PathBuf::from(r"coolfile.txt"),
    metadata: std::collections::HashMap::new(),
};

Fields

The filename, as an OsString.

The content of the file, as an owned String.

The absolute path of the file, as a PathBuf.

The relative path of the file, as a PathBuf.

Metadata that's relevant to the file, in a HashMap.

Trait Implementations

impl Debug for SimpleFile
[src]

Formats the value using the given formatter. Read more

impl PartialEq for SimpleFile
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for SimpleFile
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for SimpleFile

impl Sync for SimpleFile