#[repr(C)]pub(crate) struct ReadableByteStreamController {Show 13 fields
reflector_: Reflector,
auto_allocate_chunk_size: Option<u64>,
stream: MutNullableDom<ReadableStream>,
strategy_hwm: f64,
underlying_source: MutNullableDom<UnderlyingSourceContainer>,
queue: DomRefCell<VecDeque<QueueEntry>>,
queue_total_size: Cell<f64>,
byob_request: MutNullableDom<ReadableStreamBYOBRequest>,
pending_pull_intos: DomRefCell<Vec<PullIntoDescriptor>>,
close_requested: Cell<bool>,
started: Cell<bool>,
pulling: Cell<bool>,
pull_again: Cell<bool>,
}Expand description
Fields§
§reflector_: Reflector§auto_allocate_chunk_size: Option<u64>§stream: MutNullableDom<ReadableStream>§strategy_hwm: f64§underlying_source: MutNullableDom<UnderlyingSourceContainer>A mutable reference to the underlying source is used to implement these two internal slots:
https://streams.spec.whatwg.org/#readablebytestreamcontroller-pullalgorithm https://streams.spec.whatwg.org/#readablebytestreamcontroller-cancelalgorithm
queue: DomRefCell<VecDeque<QueueEntry>>§queue_total_size: Cell<f64>§byob_request: MutNullableDom<ReadableStreamBYOBRequest>§pending_pull_intos: DomRefCell<Vec<PullIntoDescriptor>>§close_requested: Cell<bool>§started: Cell<bool>§pulling: Cell<bool>§pull_again: Cell<bool>Implementations§
Source§impl ReadableByteStreamController
impl ReadableByteStreamController
fn new_inherited( underlying_source_type: UnderlyingSourceType<'_>, strategy_hwm: f64, global: &GlobalScope, can_gc: CanGc, ) -> ReadableByteStreamController
pub(crate) fn new( underlying_source_type: UnderlyingSourceType<'_>, strategy_hwm: f64, global: &GlobalScope, can_gc: CanGc, ) -> DomRoot<ReadableByteStreamController>
pub(crate) fn set_stream(&self, stream: &ReadableStream)
Sourcepub(crate) fn perform_pull_into(
&self,
cx: &mut JSContext,
read_into_request: &ReadIntoRequest,
view: &HeapBufferSource<ArrayBufferViewU8>,
min: u64,
)
pub(crate) fn perform_pull_into( &self, cx: &mut JSContext, read_into_request: &ReadIntoRequest, view: &HeapBufferSource<ArrayBufferViewU8>, min: u64, )
Sourcefn respond_in_closed_state(&self, cx: &mut JSContext) -> Fallible<()>
fn respond_in_closed_state(&self, cx: &mut JSContext) -> Fallible<()>
Sourcefn respond_in_readable_state(
&self,
cx: &mut JSContext,
bytes_written: u64,
) -> Fallible<()>
fn respond_in_readable_state( &self, cx: &mut JSContext, bytes_written: u64, ) -> Fallible<()>
Sourcepub(crate) fn respond_with_new_view(
&self,
cx: &mut JSContext,
view: &HeapBufferSource<ArrayBufferViewU8>,
) -> Fallible<()>
pub(crate) fn respond_with_new_view( &self, cx: &mut JSContext, view: &HeapBufferSource<ArrayBufferViewU8>, ) -> Fallible<()>
Sourcepub(crate) fn get_desired_size(&self) -> Option<f64>
pub(crate) fn get_desired_size(&self) -> Option<f64>
Sourcepub(crate) fn get_byob_request(
&self,
cx: &mut JSContext,
) -> Fallible<Option<DomRoot<ReadableStreamBYOBRequest>>>
pub(crate) fn get_byob_request( &self, cx: &mut JSContext, ) -> Fallible<Option<DomRoot<ReadableStreamBYOBRequest>>>
Sourcepub(crate) fn error(&self, cx: &mut JSContext, e: SafeHandleValue<'_>)
pub(crate) fn error(&self, cx: &mut JSContext, e: SafeHandleValue<'_>)
Sourcefn clear_algorithms(&self)
fn clear_algorithms(&self)
Sourcepub(crate) fn reset_queue(&self)
pub(crate) fn reset_queue(&self)
Sourcepub(crate) fn clear_pending_pull_intos(&self)
pub(crate) fn clear_pending_pull_intos(&self)
Sourcepub(crate) fn invalidate_byob_request(&self)
pub(crate) fn invalidate_byob_request(&self)
Sourcepub(crate) fn enqueue(
&self,
cx: &mut JSContext,
chunk: RootedTraceableBox<HeapBufferSource<ArrayBufferViewU8>>,
) -> Fallible<()>
pub(crate) fn enqueue( &self, cx: &mut JSContext, chunk: RootedTraceableBox<HeapBufferSource<ArrayBufferViewU8>>, ) -> Fallible<()>
Sourcefn commit_pull_into_descriptor(
&self,
cx: &mut JSContext,
pull_into_descriptor: &PullIntoDescriptor,
) -> Fallible<()>
fn commit_pull_into_descriptor( &self, cx: &mut JSContext, pull_into_descriptor: &PullIntoDescriptor, ) -> Fallible<()>
Sourcepub(crate) fn convert_pull_into_descriptor(
&self,
cx: &mut JSContext,
pull_into_descriptor: &PullIntoDescriptor,
) -> Fallible<RootedTraceableBox<HeapBufferSource<ArrayBufferViewU8>>>
pub(crate) fn convert_pull_into_descriptor( &self, cx: &mut JSContext, pull_into_descriptor: &PullIntoDescriptor, ) -> Fallible<RootedTraceableBox<HeapBufferSource<ArrayBufferViewU8>>>
Sourcepub(crate) fn process_pull_into_descriptors_using_queue(
&self,
cx: &mut JSContext,
) -> Vec<PullIntoDescriptor>
pub(crate) fn process_pull_into_descriptors_using_queue( &self, cx: &mut JSContext, ) -> Vec<PullIntoDescriptor>
Sourcepub(crate) fn fill_pull_into_descriptor_from_queue(
&self,
cx: &mut JSContext,
pull_into_descriptor: &PullIntoDescriptor,
) -> bool
pub(crate) fn fill_pull_into_descriptor_from_queue( &self, cx: &mut JSContext, pull_into_descriptor: &PullIntoDescriptor, ) -> bool
Sourcepub(crate) fn fill_head_pull_into_descriptor(
&self,
bytes_copied: u64,
pull_into_descriptor: &PullIntoDescriptor,
)
pub(crate) fn fill_head_pull_into_descriptor( &self, bytes_copied: u64, pull_into_descriptor: &PullIntoDescriptor, )
Sourcepub(crate) fn enqueue_detached_pull_into_to_queue(
&self,
cx: &mut JSContext,
) -> Fallible<()>
pub(crate) fn enqueue_detached_pull_into_to_queue( &self, cx: &mut JSContext, ) -> Fallible<()>
Sourcepub(crate) fn enqueue_cloned_chunk_to_queue(
&self,
cx: &mut JSContext,
buffer: &HeapBufferSource<ArrayBufferU8>,
byte_offset: u64,
byte_length: u64,
) -> Fallible<()>
pub(crate) fn enqueue_cloned_chunk_to_queue( &self, cx: &mut JSContext, buffer: &HeapBufferSource<ArrayBufferU8>, byte_offset: u64, byte_length: u64, ) -> Fallible<()>
Sourcepub(crate) fn enqueue_chunk_to_queue(
&self,
buffer: RootedTraceableBox<HeapBufferSource<ArrayBufferU8>>,
byte_offset: usize,
byte_length: usize,
)
pub(crate) fn enqueue_chunk_to_queue( &self, buffer: RootedTraceableBox<HeapBufferSource<ArrayBufferU8>>, byte_offset: usize, byte_length: usize, )
Sourcepub(crate) fn shift_pending_pull_into(&self) -> PullIntoDescriptor
pub(crate) fn shift_pending_pull_into(&self) -> PullIntoDescriptor
Sourcepub(crate) fn process_read_requests_using_queue(
&self,
cx: &mut JSContext,
) -> Fallible<()>
pub(crate) fn process_read_requests_using_queue( &self, cx: &mut JSContext, ) -> Fallible<()>
Sourcepub(crate) fn fill_read_request_from_queue(
&self,
cx: &mut JSContext,
read_request: &ReadRequest,
) -> Fallible<()>
pub(crate) fn fill_read_request_from_queue( &self, cx: &mut JSContext, read_request: &ReadRequest, ) -> Fallible<()>
Sourcepub(crate) fn handle_queue_drain(&self, cx: &mut JSContext)
pub(crate) fn handle_queue_drain(&self, cx: &mut JSContext)
Sourcefn call_pull_if_needed(&self, cx: &mut JSContext)
fn call_pull_if_needed(&self, cx: &mut JSContext)
Sourcefn should_call_pull(&self) -> bool
fn should_call_pull(&self) -> bool
Sourcepub(crate) fn setup(
&self,
cx: &mut JSContext,
global: &GlobalScope,
stream: DomRoot<ReadableStream>,
) -> Fallible<()>
pub(crate) fn setup( &self, cx: &mut JSContext, global: &GlobalScope, stream: DomRoot<ReadableStream>, ) -> Fallible<()>
pub(crate) fn perform_release_steps(&self) -> Fallible<()>
Sourcepub(crate) fn perform_cancel_steps(
&self,
cx: &mut JSContext,
global: &GlobalScope,
reason: SafeHandleValue<'_>,
) -> Rc<Promise>
pub(crate) fn perform_cancel_steps( &self, cx: &mut JSContext, global: &GlobalScope, reason: SafeHandleValue<'_>, ) -> Rc<Promise>
Sourcepub(crate) fn perform_pull_steps(
&self,
cx: &mut JSContext,
read_request: &ReadRequest,
)
pub(crate) fn perform_pull_steps( &self, cx: &mut JSContext, read_request: &ReadRequest, )
Sourcepub(crate) fn set_underlying_source_this_object(
&self,
this_object: HandleObject<'_>,
)
pub(crate) fn set_underlying_source_this_object( &self, this_object: HandleObject<'_>, )
Setting the JS object after the heap has settled down.
pub(crate) fn remove_entry(&self) -> QueueEntry
pub(crate) fn get_queue_total_size(&self) -> f64
pub(crate) fn get_pending_pull_intos_size(&self) -> usize
Trait Implementations§
Source§impl DomObject for ReadableByteStreamController
impl DomObject for ReadableByteStreamController
type ReflectorType = ()
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Returns the receiver’s reflector.
Source§impl Drop for ReadableByteStreamController
impl Drop for ReadableByteStreamController
Source§impl IDLInterface for ReadableByteStreamController
impl IDLInterface for ReadableByteStreamController
Source§const PROTO_FIRST: u16 = 442
const PROTO_FIRST: u16 = 442
First prototype ID in the DFS-ordered range for this interface and its descendants.
Source§const PROTO_LAST: u16 = 442
const PROTO_LAST: u16 = 442
Last prototype ID in the DFS-ordered range for this interface and its descendants.
Source§impl MallocSizeOf for ReadableByteStreamController
impl MallocSizeOf for ReadableByteStreamController
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl ReadableByteStreamControllerMethods<DomTypeHolder> for ReadableByteStreamController
impl ReadableByteStreamControllerMethods<DomTypeHolder> for ReadableByteStreamController
Source§fn GetByobRequest(
&self,
cx: &mut JSContext,
) -> Fallible<Option<DomRoot<ReadableStreamBYOBRequest>>>
fn GetByobRequest( &self, cx: &mut JSContext, ) -> Fallible<Option<DomRoot<ReadableStreamBYOBRequest>>>
Source§fn GetDesiredSize(&self) -> Option<f64>
fn GetDesiredSize(&self) -> Option<f64>
Source§fn Enqueue(
&self,
cx: &mut JSContext,
chunk: CustomAutoRooterGuard<'_, ArrayBufferView>,
) -> Fallible<()>
fn Enqueue( &self, cx: &mut JSContext, chunk: CustomAutoRooterGuard<'_, ArrayBufferView>, ) -> Fallible<()>
Source§impl ToJSValConvertible for ReadableByteStreamController
impl ToJSValConvertible for ReadableByteStreamController
Source§unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
Convert
self to a JSVal. JSAPI failure causes a panic.Source§fn safe_to_jsval(&self, cx: &mut JSContext, rval: MutableHandle<'_, Value>)
fn safe_to_jsval(&self, cx: &mut JSContext, rval: MutableHandle<'_, Value>)
Convert
self to a JSVal. JSAPI failure causes a panic.impl Eq for ReadableByteStreamController
Auto Trait Implementations§
impl !Freeze for ReadableByteStreamController
impl !RefUnwindSafe for ReadableByteStreamController
impl !Send for ReadableByteStreamController
impl !Sync for ReadableByteStreamController
impl Unpin for ReadableByteStreamController
impl UnsafeUnpin for ReadableByteStreamController
impl !UnwindSafe for ReadableByteStreamController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
Returns the [
GlobalScope] of the realm that the DomObject was created in. If this
object is a Node, this will be different from it’s owning Document if adopted by. For
Nodes it’s almost always better to use NodeTraits::owning_global.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert