Expand description
Version 2 of the Eszip format. This format supports streaming sources and source maps.
Fields
ordered_modules: Vec<String>
Implementations
sourceimpl EszipV2
impl EszipV2
sourcepub async fn parse<R: AsyncRead + Unpin>(
reader: BufReader<R>
) -> Result<(EszipV2, impl Future<Output = Result<BufReader<R>, ParseError>>), ParseError>
pub async fn parse<R: AsyncRead + Unpin>(
reader: BufReader<R>
) -> Result<(EszipV2, impl Future<Output = Result<BufReader<R>, ParseError>>), ParseError>
Parse a EszipV2 from an AsyncRead stream. This function returns once the header section of the eszip has been parsed. Once this function returns, the data section will not necessarially have been parsed yet. To parse the data section, poll/await the future returned in the second tuple slot.
sourcepub fn add_import_map(&mut self, specifier: String, source: Arc<Vec<u8>>)
pub fn add_import_map(&mut self, specifier: String, source: Arc<Vec<u8>>)
Add an import map to the eszip archive. The import map will always be placed at the top of the archive, so it can be read before any other modules are loaded.
If a module with this specifier is already present, then this is a no-op (except that this specifier will now be at the top of the archive).
sourcepub fn into_bytes(self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn into_bytes(self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Serialize the eszip archive into a byte buffer.
sourcepub fn from_graph(
graph: ModuleGraph,
emit_options: EmitOptions
) -> Result<Self, Error>
pub fn from_graph(
graph: ModuleGraph,
emit_options: EmitOptions
) -> Result<Self, Error>
Turn a deno_graph::ModuleGraph into an EszipV2. All modules from the graph will be transpiled and stored in the eszip archive.
The ordering of the modules in the graph is dependant on the module graph tree. The root module is added to the top of the archive, and the leaves to the end. This allows for efficient deserialization of the archive right into an isolate.
sourcepub fn get_module(&self, specifier: &str) -> Option<Module>
pub fn get_module(&self, specifier: &str) -> Option<Module>
Get the module metadata for a given module specifier. This function will follow redirects. The returned module has functions that can be used to obtain the module source and source map.
pub fn specifiers(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for EszipV2
impl Send for EszipV2
impl Sync for EszipV2
impl Unpin for EszipV2
impl UnwindSafe for EszipV2
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more