pub struct SimpleFile {
pub name: OsString,
pub content: String,
pub rel_path: PathBuf,
pub metadata: HashMap<&'static str, String>,
}
Expand description
A struct describing a simple file, with only a name, content, path (relative & absolute), and custom metadata.
§Examples
let file = ko::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§
Source§impl Clone for SimpleFile
impl Clone for SimpleFile
Source§fn clone(&self) -> SimpleFile
fn clone(&self) -> SimpleFile
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SimpleFile
impl Debug for SimpleFile
Source§impl PartialEq for SimpleFile
impl PartialEq for SimpleFile
impl StructuralPartialEq for SimpleFile
Auto Trait Implementations§
impl Freeze for SimpleFile
impl RefUnwindSafe for SimpleFile
impl Send for SimpleFile
impl Sync for SimpleFile
impl Unpin for SimpleFile
impl UnwindSafe for SimpleFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more