pub struct FileSource {
pub id: Uuid,
pub path: String,
pub source: Option<String>,
pub access: Option<SystemTime>,
pub dependencies: Option<Vec<FileSource>>,
}Expand description
File Encapsulation
Fields§
§id: UuidFile ID
path: StringFile Path
source: Option<String>File Source
access: Option<SystemTime>Last File Access Time
dependencies: Option<Vec<FileSource>>An Ordered List of File Dependencies
Implementations§
Source§impl FileSource
impl FileSource
Sourcepub fn fully_flatten(&self) -> String
pub fn fully_flatten(&self) -> String
Generates a fully flattened source code for the given FileSource and all its dependencies
§Examples
Let’s say you have a file, a.txt with two dependencies, b.txt and c.txt,
fully_flatten() will generate a source code string with the contents of b.txt and
c.txt appended to the end of the contents of a.txt.
Sourcepub fn derive_dir(path: &str) -> Option<String>
pub fn derive_dir(path: &str) -> Option<String>
Derives a File Path’s directory
Trait Implementations§
Source§impl Clone for FileSource
impl Clone for FileSource
Source§fn clone(&self) -> FileSource
fn clone(&self) -> FileSource
Returns a duplicate 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 FileSource
impl Debug for FileSource
Source§impl Default for FileSource
impl Default for FileSource
Source§fn default() -> FileSource
fn default() -> FileSource
Returns the “default value” for a type. Read more
Source§impl Ord for FileSource
impl Ord for FileSource
Source§fn cmp(&self, other: &FileSource) -> Ordering
fn cmp(&self, other: &FileSource) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FileSource
impl PartialEq for FileSource
Source§impl PartialOrd for FileSource
impl PartialOrd for FileSource
impl Eq for FileSource
impl StructuralPartialEq for FileSource
Auto Trait Implementations§
impl Freeze for FileSource
impl RefUnwindSafe for FileSource
impl Send for FileSource
impl Sync for FileSource
impl Unpin for FileSource
impl UnwindSafe for FileSource
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