Struct rspack_sources::SourceMap
source · pub struct SourceMap { /* private fields */ }
Expand description
The source map created by Source::map.
Implementations§
source§impl SourceMap
impl SourceMap
sourcepub fn new(
file: Option<String>,
mappings: String,
sources: Vec<Cow<'static, str>>,
sources_content: Vec<Cow<'static, str>>,
names: Vec<Cow<'static, str>>,
) -> Self
pub fn new( file: Option<String>, mappings: String, sources: Vec<Cow<'static, str>>, sources_content: Vec<Cow<'static, str>>, names: Vec<Cow<'static, str>>, ) -> Self
Create a SourceMap.
sourcepub fn decoded_mappings(&self) -> impl IntoIterator<Item = Mapping> + '_
pub fn decoded_mappings(&self) -> impl IntoIterator<Item = Mapping> + '_
Get the decoded mappings in SourceMap.
sourcepub fn sources_mut(&mut self) -> &mut [Cow<'static, str>]
pub fn sources_mut(&mut self) -> &mut [Cow<'static, str>]
Get the mutable sources field in SourceMap.
sourcepub fn get_source(&self, index: usize) -> Option<&str>
pub fn get_source(&self, index: usize) -> Option<&str>
Get the source by index from sources field in SourceMap.
sourcepub fn get_source_mut(&mut self, index: usize) -> Option<&mut Cow<'static, str>>
pub fn get_source_mut(&mut self, index: usize) -> Option<&mut Cow<'static, str>>
Get the mutable source by index from sources field in SourceMap.
sourcepub fn sources_content(&self) -> &[Cow<'static, str>]
pub fn sources_content(&self) -> &[Cow<'static, str>]
Get the sourcesContent field in SourceMap.
sourcepub fn sources_content_mut(&mut self) -> &mut [Cow<'static, str>]
pub fn sources_content_mut(&mut self) -> &mut [Cow<'static, str>]
Get the mutable sourcesContent field in SourceMap.
sourcepub fn get_source_content(&self, index: usize) -> Option<&str>
pub fn get_source_content(&self, index: usize) -> Option<&str>
Get the source content by index from sourcesContent field in SourceMap.
sourcepub fn get_source_content_mut(
&mut self,
index: usize,
) -> Option<&mut Cow<'static, str>>
pub fn get_source_content_mut( &mut self, index: usize, ) -> Option<&mut Cow<'static, str>>
Get the mutable source content by index from sourcesContent field in SourceMap.
sourcepub fn get_name(&self, index: usize) -> Option<&str>
pub fn get_name(&self, index: usize) -> Option<&str>
Get the name by index from names field in SourceMap.
sourcepub fn get_name_mut(&mut self, index: usize) -> Option<&mut Cow<'static, str>>
pub fn get_name_mut(&mut self, index: usize) -> Option<&mut Cow<'static, str>>
Get the mutable name by index from names field in SourceMap.
sourcepub fn source_root(&self) -> Option<&str>
pub fn source_root(&self) -> Option<&str>
Get the source_root field in SourceMap.
sourcepub fn set_source_root(&mut self, source_root: Option<String>)
pub fn set_source_root(&mut self, source_root: Option<String>)
Set the source_root field in SourceMap.
Trait Implementations§
impl Eq for SourceMap
impl StructuralPartialEq for SourceMap
Auto Trait Implementations§
impl !Freeze for SourceMap
impl RefUnwindSafe for SourceMap
impl Send for SourceMap
impl Sync for SourceMap
impl Unpin for SourceMap
impl UnwindSafe for SourceMap
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)