pub struct SourceMap { /* private fields */ }Expand description
The source map created by Source::map.
Implementations§
Source§impl SourceMap
impl SourceMap
Sourcepub fn new<Mappings, Sources, SourcesContent, Names>(
mappings: Mappings,
sources: Sources,
sources_content: SourcesContent,
names: Names,
) -> Self
pub fn new<Mappings, Sources, SourcesContent, Names>( mappings: Mappings, sources: Sources, sources_content: SourcesContent, names: Names, ) -> Self
Create a SourceMap.
Sourcepub fn set_file<T: Into<Arc<str>>>(&mut self, file: Option<T>)
pub fn set_file<T: Into<Arc<str>>>(&mut self, file: Option<T>)
Set the file field in SourceMap.
Sourcepub fn decoded_mappings(&self) -> impl Iterator<Item = Mapping> + '_
pub fn decoded_mappings(&self) -> impl Iterator<Item = Mapping> + '_
Get the decoded mappings in SourceMap.
Sourcepub fn set_sources<T: Into<Arc<[String]>>>(&mut self, sources: T)
pub fn set_sources<T: Into<Arc<[String]>>>(&mut self, sources: T)
Set the 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 sources_content(&self) -> &[String]
pub fn sources_content(&self) -> &[String]
Get the sourcesContent field in SourceMap.
Sourcepub fn set_sources_content<T: Into<Arc<[String]>>>(
&mut self,
sources_content: T,
)
pub fn set_sources_content<T: Into<Arc<[String]>>>( &mut self, sources_content: T, )
Set the 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 set_names<T: Into<Arc<[String]>>>(&mut self, names: T)
pub fn set_names<T: Into<Arc<[String]>>>(&mut self, names: T)
Set the names 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 source_root(&self) -> Option<&str>
pub fn source_root(&self) -> Option<&str>
Get 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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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 more