Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WasmPackage should have a constructor with an optional FileReader #45

Open
krisbitney opened this issue Mar 2, 2023 · 0 comments
Open

Comments

@krisbitney
Copy link
Contributor

The current WasmPackage constructor looks like this:

pub fn new(
        file_reader: Arc<dyn FileReader>,
        manifest: Option<Vec<u8>>,
        wasm_module: Option<Vec<u8>>,
    ) -> Self
    
// example usage
WasmPackage::new(
    Arc::new(SimpleFileReader::new()),
    wrap_info().ok(),
    wrap_wasm().ok()
)

It would be good for UX to have one that requires manifest and wasm_module, allowing the FileReader to be assigned a default. The default FileReader could be the SimpleFileReader from the core.

pub fn new(
        manifest: Vec<u8>,
        wasm_module: Vec<u8>,
    ) -> Self

// example usage
WasmPackage::new(
    wrap_info().ok().unwrap(),
    wrap_wasm().ok().unwrap(),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant