pub struct FileSource {
pub path: String,
pub source: Option<String>,
pub access: Option<Time>,
pub dependencies: Vec<Arc<FileSource>>,
}Expand description
File Encapsulation
Fields§
§path: StringFile Path
source: Option<String>File Source
access: Option<Time>Last File Access Time
dependencies: Vec<Arc<FileSource>>An Ordered List of File Dependencies
Implementations§
Source§impl FileSource
impl FileSource
Sourcefn discover_all_file_sources(
node_file_source: Arc<FileSource>,
visited_nodes: &mut HashSet<String>,
) -> Vec<Arc<FileSource>>
fn discover_all_file_sources( node_file_source: Arc<FileSource>, visited_nodes: &mut HashSet<String>, ) -> Vec<Arc<FileSource>>
Visit all dependencies and return a list of none duplicate FileSource in order of occurrence.
Sourcepub fn fully_flatten(
node_file_source: Arc<FileSource>,
) -> (String, Vec<(Arc<FileSource>, Span)>)
pub fn fully_flatten( node_file_source: Arc<FileSource>, ) -> (String, Vec<(Arc<FileSource>, Span)>)
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.
Note: This preserves #include statements in the output to maintain correct span positions
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§impl Debug for FileSource
impl Debug for FileSource
Source§impl Default for FileSource
impl Default for FileSource
Source§impl<'de> Deserialize<'de> for FileSource
impl<'de> Deserialize<'de> for FileSource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for FileSource
Source§impl From<FileSource> for JsValuewhere
FileSource: Serialize,
impl From<FileSource> for JsValuewhere
FileSource: Serialize,
Source§fn from(value: FileSource) -> Self
fn from(value: FileSource) -> Self
Source§impl FromWasmAbi for FileSourcewhere
Self: DeserializeOwned,
impl FromWasmAbi for FileSourcewhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for &FileSourcewhere
FileSource: Serialize,
impl IntoWasmAbi for &FileSourcewhere
FileSource: Serialize,
Source§impl IntoWasmAbi for FileSourcewhere
FileSource: Serialize,
impl IntoWasmAbi for FileSourcewhere
FileSource: Serialize,
Source§impl OptionFromWasmAbi for FileSourcewhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for FileSourcewhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for FileSourcewhere
FileSource: Serialize,
impl OptionIntoWasmAbi for FileSourcewhere
FileSource: Serialize,
Source§impl Ord for FileSource
impl Ord for FileSource
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for FileSource
impl PartialEq for FileSource
Source§impl PartialOrd for FileSource
impl PartialOrd for FileSource
Source§impl RefFromWasmAbi for FileSourcewhere
Self: DeserializeOwned,
impl RefFromWasmAbi for FileSourcewhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = SelfOwner<FileSource>
type Anchor = SelfOwner<FileSource>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl Serialize for FileSource
impl Serialize for FileSource
impl StructuralPartialEq for FileSource
Source§impl Tsify for FileSource
impl Tsify for FileSource
const DECL: &'static str = "/**\n * File Encapsulation\n */\nexport interface FileSource {\n /**\n * File Path\n */\n path: string;\n /**\n * File Source\n */\n source: string | undefined;\n /**\n * Last File Access Time\n */\n access: number | undefined;\n /**\n * An Ordered List of File Dependencies\n */\n dependencies: FileSource[];\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for FileSourcewhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for FileSourcewhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for FileSourcewhere
FileSource: Serialize,
impl VectorIntoWasmAbi for FileSourcewhere
FileSource: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribe for FileSource
impl WasmDescribe for FileSource
Source§impl WasmDescribeVector for FileSource
impl WasmDescribeVector 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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.Source§impl<S, T> Upcast<T> for S
impl<S, T> Upcast<T> for S
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 88 bytes