Struct nya::SimpleFile [−][src]
pub struct SimpleFile { pub name: OsString, pub content: String, 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(), rel_path: std::path::PathBuf::from(r"coolfile.txt"), metadata: std::collections::HashMap::new(), };
Fields
name: OsString
The filename, as an OsString
.
content: String
The content of the file, as an owned String
.
rel_path: PathBuf
The relative path of the file, as a PathBuf
.
metadata: HashMap<&'static str, String>
Metadata that's relevant to the file, in a HashMap
.
Trait Implementations
impl Debug for SimpleFile
[src]
impl Debug for SimpleFile
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for SimpleFile
[src]
impl PartialEq for SimpleFile
fn eq(&self, other: &SimpleFile) -> bool
[src]
fn eq(&self, other: &SimpleFile) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &SimpleFile) -> bool
[src]
fn ne(&self, other: &SimpleFile) -> bool
This method tests for !=
.
impl Clone for SimpleFile
[src]
impl Clone for SimpleFile
fn clone(&self) -> SimpleFile
[src]
fn clone(&self) -> SimpleFile
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for SimpleFile
impl Send for SimpleFile
impl Sync for SimpleFile
impl Sync for SimpleFile