zhiqiangxu opened PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state.
zhiqiangxu edited PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state when instantiate wasm instance.
zhiqiangxu edited PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state when instantiate a wasm instance.
bjorn3 submitted PR Review.
bjorn3 submitted PR Review.
bjorn3 created PR Review Comment:
pub fn new(store: &Store, module: &Module, imports: &[Extern]) -> Result<Instance, Error> { Instance::new_with_user_state(store, module, imports, None) }
This function is also missing documentation.
bjorn3 created PR Review Comment:
pub fn new_with_user_state(
zhiqiangxu updated PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state when instantiate a wasm instance.
zhiqiangxu submitted PR Review.
zhiqiangxu created PR Review Comment:
Fixed,
_new
is removed.One can access the user state by
instance.host_state()
then cast it toHostState
bjorn3 submitted PR Review.
bjorn3 created PR Review Comment:
Instance::new_with_user_state(store, module, imports, None)
- You can't use
new_with_user_state
directly as it isn't imported in the current module.- Please prefer implicit return at the end of a block/function.
zhiqiangxu updated PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state when instantiate a wasm instance.
zhiqiangxu updated PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state when instantiate a wasm instance.
zhiqiangxu submitted PR Review.
zhiqiangxu created PR Review Comment:
Fixed.
zhiqiangxu updated PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state when instantiate a wasm instance.
zhiqiangxu updated PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state when instantiate a wasm instance.
bjorn3 created PR Review Comment:
This shouldn't be necessary.
bjorn3 submitted PR Review.
zhiqiangxu submitted PR Review.
zhiqiangxu created PR Review Comment:
Otherwise it will report: warning: field is never read:
frame_info_registration
.
bjorn3 submitted PR Review.
bjorn3 created PR Review Comment:
_frame_info_registration: Option<Arc<GlobalFrameInfoRegistration>>,
This supressed the dead code warning for this field only.
bjorn3 edited PR Review Comment.
zhiqiangxu submitted PR Review.
zhiqiangxu created PR Review Comment:
I moved
#[allow(dead_code)]
to above theframe_info_registration
field
zhiqiangxu updated PR #2282 from custom_user_state
to main
:
Allow user to specify custom user state when instantiate a wasm instance.
alexcrichton closed without merge PR #2282.
Last updated: Dec 23 2024 at 12:05 UTC