pub struct SourceFileInfo { /* private fields */ }
Expand description
Meta data information of a file in a SourceBundle
.
Implementations§
Source§impl SourceFileInfo
impl SourceFileInfo
Sourcepub fn ty(&self) -> Option<SourceFileType>
pub fn ty(&self) -> Option<SourceFileType>
Returns the type of the source file.
Sourcepub fn set_ty(&mut self, ty: SourceFileType)
pub fn set_ty(&mut self, ty: SourceFileType)
Sets the type of the source file.
Sourcepub fn headers(&self) -> impl Iterator<Item = (&str, &str)>
pub fn headers(&self) -> impl Iterator<Item = (&str, &str)>
Iterates over all attributes represented as headers.
Sourcepub fn header(&self, header: &str) -> Option<&str>
pub fn header(&self, header: &str) -> Option<&str>
Retrieves the specified header, if it exists.
Sourcepub fn add_header(&mut self, header: String, value: String)
pub fn add_header(&mut self, header: String, value: String)
Adds a custom attribute following header conventions.
Header keys are converted to lowercase before writing as this is the canonical format for headers. However, the file format does support headers to be case insensitive and they will be lower cased upon reading.
Headers on files are primarily be used to add auxiliary information to files. The following headers are known and processed:
debug-id
: seedebug_id
sourcemap
(andx-sourcemap
): seesource_mapping_url
Sourcepub fn debug_id(&self) -> Option<DebugId>
pub fn debug_id(&self) -> Option<DebugId>
The debug ID of this minified source or sourcemap if it has any.
Files have a debug ID if they have a header with the key debug-id
.
At present debug IDs in source bundles are only ever given to minified
source files.
Sourcepub fn source_mapping_url(&self) -> Option<&str>
pub fn source_mapping_url(&self) -> Option<&str>
The source mapping URL of the given minified source.
Files have a source mapping URL if they have a header with the
key sourcemap
(or the x-sourcemap
legacy header) as part the
source map specification.
Trait Implementations§
Source§impl Clone for SourceFileInfo
impl Clone for SourceFileInfo
Source§fn clone(&self) -> SourceFileInfo
fn clone(&self) -> SourceFileInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more