diff options
Diffstat (limited to 'core/ops_builtin.rs')
-rw-r--r-- | core/ops_builtin.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs index 392062960..bb04cddf4 100644 --- a/core/ops_builtin.rs +++ b/core/ops_builtin.rs @@ -26,6 +26,10 @@ pub(crate) fn init_builtins() -> Extension { ("op_resources", op_sync(op_resources)), ("op_wasm_streaming_feed", op_sync(op_wasm_streaming_feed)), ("op_wasm_streaming_abort", op_sync(op_wasm_streaming_abort)), + ( + "op_wasm_streaming_set_url", + op_sync(op_wasm_streaming_set_url), + ), ]) .build() } @@ -137,3 +141,16 @@ pub fn op_wasm_streaming_abort( Ok(()) } + +pub fn op_wasm_streaming_set_url( + state: &mut OpState, + rid: ResourceId, + url: String, +) -> Result<(), AnyError> { + let wasm_streaming = + state.resource_table.get::<WasmStreamingResource>(rid)?; + + wasm_streaming.0.borrow_mut().set_url(&url); + + Ok(()) +} |