[][src]Struct sourcemap::ram_bundle::RamBundle

pub struct RamBundle<'a> { /* fields omitted */ }

The main RAM bundle interface

Implementations

impl<'a> RamBundle<'a>[src]

pub fn parse_indexed_from_slice(bytes: &'a [u8]) -> Result<Self>[src]

Parses an indexed RAM bundle from the given slice

pub fn parse_indexed_from_vec(bytes: Vec<u8>) -> Result<Self>[src]

Parses an indexed RAM bundle from the given vector

pub fn parse_indexed_from_path(path: &Path) -> Result<Self>[src]

Creates a new indexed RAM bundle from the file path

pub fn parse_unbundle_from_path(bundle_path: &Path) -> Result<Self>[src]

Creates a file (unbundle) RAM bundle from the path

The provided path should point to a javascript file, that serves as an entry point (startup code) for the app. The modules are stored in js-modules/ directory, next to the entry point.

pub fn bundle_type(&self) -> RamBundleType[src]

Returns the type of the RAM bundle.

pub fn get_module(&self, id: usize) -> Result<Option<RamBundleModule>>[src]

Looks up a module by ID in the bundle

pub fn module_count(&self) -> usize[src]

Returns the number of modules in the bundle

pub fn startup_code(&self) -> Result<&[u8]>[src]

Returns the startup code

pub fn iter_modules(&self) -> RamBundleModuleIter

Important traits for RamBundleModuleIter<'a>

impl<'a> Iterator for RamBundleModuleIter<'a> type Item = Result<RamBundleModule<'a>>;
[src]

Returns an iterator over all modules in the bundle

Trait Implementations

impl<'a> Clone for RamBundle<'a>[src]

impl<'a> Debug for RamBundle<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for RamBundle<'a>

impl<'a> Send for RamBundle<'a>

impl<'a> Sync for RamBundle<'a>

impl<'a> Unpin for RamBundle<'a>

impl<'a> UnwindSafe for RamBundle<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.