Enum rspack_sources::RawSource
source · pub enum RawSource {
Buffer(Vec<u8>),
Source(String),
}
Expand description
Represents source code without source map, it will not create source map for the source code.
use rspack_sources::{MapOptions, RawSource, Source};
let code = "some source code";
let s = RawSource::from(code.to_string());
assert_eq!(s.source(), code);
assert_eq!(s.map(&MapOptions::default()), None);
assert_eq!(s.size(), 16);
Variants§
Implementations§
Trait Implementations§
source§impl PartialEq for RawSource
impl PartialEq for RawSource
source§impl Source for RawSource
impl Source for RawSource
source§impl StreamChunks for RawSource
impl StreamChunks for RawSource
source§fn stream_chunks(
&self,
options: &MapOptions,
on_chunk: OnChunk<'_>,
on_source: OnSource<'_>,
on_name: OnName<'_>,
) -> GeneratedInfo
fn stream_chunks( &self, options: &MapOptions, on_chunk: OnChunk<'_>, on_source: OnSource<'_>, on_name: OnName<'_>, ) -> GeneratedInfo
StreamChunks abstraction
impl Eq for RawSource
Auto Trait Implementations§
impl Freeze for RawSource
impl RefUnwindSafe for RawSource
impl Send for RawSource
impl Sync for RawSource
impl Unpin for RawSource
impl UnwindSafe for RawSource
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