Function script::dom::bindings::import::module::jsapi::JS::ReadableStreamEnqueue

source ·
pub unsafe extern "C" fn ReadableStreamEnqueue(
    cx: *mut JSContext,
    stream: Handle<*mut JSObject>,
    chunk: Handle<Value>,
) -> bool
Expand description

Enqueues the given chunk in the given ReadableStream.

Throws a TypeError and returns false if the enqueing operation fails.

Note: This is semantically equivalent to the |enqueue| method on the stream controller’s prototype in JS. We expose it with the stream itself as a target for simplicity.

If the ReadableStream has an underlying byte source, the given chunk must be a typed array or a DataView. Consider using ReadableByteStreamEnqueueBuffer.

Asserts that |stream| is a ReadableStream object or an unwrappable wrapper for one.