diff options
Diffstat (limited to 'ext/web/lib.rs')
-rw-r--r-- | ext/web/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/web/lib.rs b/ext/web/lib.rs index 85e32b70a..8a9d3e18c 100644 --- a/ext/web/lib.rs +++ b/ext/web/lib.rs @@ -94,6 +94,7 @@ pub fn init<P: TimersPermission + 'static>( op_encoding_new_decoder::decl(), op_encoding_decode::decl(), op_encoding_encode_into::decl(), + op_encode_binary_string::decl(), op_blob_create_part::decl(), op_blob_slice_part::decl(), op_blob_read_part::decl(), @@ -337,6 +338,11 @@ fn op_encoding_encode_into( Ok(()) } +#[op] +fn op_encode_binary_string(s: &[u8]) -> ByteString { + ByteString::from(s) +} + /// Creates a [`CancelHandle`] resource that can be used to cancel invocations of certain ops. #[op(fast)] pub fn op_cancel_handle(state: &mut OpState) -> u32 { |