Trait rspack_sources::Source
source · pub trait Source: StreamChunks + DynHash + AsAny + DynEq + DynClone + Debug + Sync + Send {
// Required methods
fn source(&self) -> Cow<'_, str>;
fn buffer(&self) -> Cow<'_, [u8]>;
fn size(&self) -> usize;
fn map(&self, options: &MapOptions) -> Option<SourceMap>;
fn to_writer(&self, writer: &mut dyn Write) -> Result<()>;
// Provided method
fn update_hash(&self, state: &mut dyn Hasher) { ... }
}
Expand description
Source abstraction, webpack-sources docs.
Required Methods§
Provided Methods§
sourcefn update_hash(&self, state: &mut dyn Hasher)
fn update_hash(&self, state: &mut dyn Hasher)
Update hash based on the source.