#[repr(C)]pub struct WritableStreamDefaultController {
reflector_: Reflector,
abort: RefCell<Option<Rc<UnderlyingSinkAbortCallback<DomTypeHolder>>>>,
close: RefCell<Option<Rc<UnderlyingSinkCloseCallback<DomTypeHolder>>>>,
write: RefCell<Option<Rc<UnderlyingSinkWriteCallback<DomTypeHolder>>>>,
underlying_sink_obj: Heap<*mut JSObject>,
queue: RefCell<QueueWithSizes>,
started: Cell<bool>,
strategy_hwm: f64,
strategy_size: RefCell<Option<Rc<QueuingStrategySize<DomTypeHolder>>>>,
stream: MutNullableDom<WritableStream>,
}
Expand description
Fields§
§reflector_: Reflector
§abort: RefCell<Option<Rc<UnderlyingSinkAbortCallback<DomTypeHolder>>>>
§close: RefCell<Option<Rc<UnderlyingSinkCloseCallback<DomTypeHolder>>>>
§write: RefCell<Option<Rc<UnderlyingSinkWriteCallback<DomTypeHolder>>>>
§underlying_sink_obj: Heap<*mut JSObject>
The JS object used as this
when invoking sink algorithms.
queue: RefCell<QueueWithSizes>
§started: Cell<bool>
§strategy_hwm: f64
§strategy_size: RefCell<Option<Rc<QueuingStrategySize<DomTypeHolder>>>>
§stream: MutNullableDom<WritableStream>
Implementations§
Source§impl WritableStreamDefaultController
impl WritableStreamDefaultController
Sourcefn new_inherited(
underlying_sink: &UnderlyingSink<DomTypeHolder>,
strategy_hwm: f64,
strategy_size: Rc<QueuingStrategySize<DomTypeHolder>>,
) -> WritableStreamDefaultController
fn new_inherited( underlying_sink: &UnderlyingSink<DomTypeHolder>, strategy_hwm: f64, strategy_size: Rc<QueuingStrategySize<DomTypeHolder>>, ) -> WritableStreamDefaultController
pub(crate) fn new( global: &GlobalScope, underlying_sink: &UnderlyingSink<DomTypeHolder>, strategy_hwm: f64, strategy_size: Rc<QueuingStrategySize<DomTypeHolder>>, can_gc: CanGc, ) -> DomRoot<WritableStreamDefaultController>
pub(crate) fn started(&self) -> bool
Sourcepub(crate) fn set_underlying_sink_this_object(
&self,
this_object: SafeHandleObject<'_>,
)
pub(crate) fn set_underlying_sink_this_object( &self, this_object: SafeHandleObject<'_>, )
Setting the JS object after the heap has settled down.
Sourcefn clear_algorithms(&self)
fn clear_algorithms(&self)
Sourcepub(crate) fn setup(
&self,
cx: SafeJSContext,
global: &GlobalScope,
stream: &WritableStream,
start: &Option<Rc<UnderlyingSinkStartCallback<DomTypeHolder>>>,
can_gc: CanGc,
) -> Result<(), Error>
pub(crate) fn setup( &self, cx: SafeJSContext, global: &GlobalScope, stream: &WritableStream, start: &Option<Rc<UnderlyingSinkStartCallback<DomTypeHolder>>>, can_gc: CanGc, ) -> Result<(), Error>
Sourcepub(crate) fn close(
&self,
cx: SafeJSContext,
global: &GlobalScope,
can_gc: CanGc,
)
pub(crate) fn close( &self, cx: SafeJSContext, global: &GlobalScope, can_gc: CanGc, )
Sourcepub(crate) fn abort_steps(
&self,
cx: SafeJSContext,
global: &GlobalScope,
reason: SafeHandleValue<'_>,
can_gc: CanGc,
) -> Rc<Promise>
pub(crate) fn abort_steps( &self, cx: SafeJSContext, global: &GlobalScope, reason: SafeHandleValue<'_>, can_gc: CanGc, ) -> Rc<Promise>
pub(crate) fn call_write_algorithm( &self, cx: SafeJSContext, chunk: SafeHandleValue<'_>, global: &GlobalScope, can_gc: CanGc, ) -> Rc<Promise>
fn call_close_algorithm( &self, cx: SafeJSContext, global: &GlobalScope, can_gc: CanGc, ) -> Rc<Promise>
Sourcepub(crate) fn process_close(
&self,
cx: SafeJSContext,
global: &GlobalScope,
can_gc: CanGc,
)
pub(crate) fn process_close( &self, cx: SafeJSContext, global: &GlobalScope, can_gc: CanGc, )
Sourcefn advance_queue_if_needed(
&self,
cx: SafeJSContext,
global: &GlobalScope,
can_gc: CanGc,
)
fn advance_queue_if_needed( &self, cx: SafeJSContext, global: &GlobalScope, can_gc: CanGc, )
Sourcepub(crate) fn perform_error_steps(&self)
pub(crate) fn perform_error_steps(&self)
Sourcefn process_write(
&self,
cx: SafeJSContext,
chunk: SafeHandleValue<'_>,
global: &GlobalScope,
can_gc: CanGc,
)
fn process_write( &self, cx: SafeJSContext, chunk: SafeHandleValue<'_>, global: &GlobalScope, can_gc: CanGc, )
Sourcepub(crate) fn get_desired_size(&self) -> f64
pub(crate) fn get_desired_size(&self) -> f64
Sourcefn get_backpressure(&self) -> bool
fn get_backpressure(&self) -> bool
Sourcepub(crate) fn get_chunk_size(
&self,
cx: SafeJSContext,
global: &GlobalScope,
chunk: SafeHandleValue<'_>,
can_gc: CanGc,
) -> f64
pub(crate) fn get_chunk_size( &self, cx: SafeJSContext, global: &GlobalScope, chunk: SafeHandleValue<'_>, can_gc: CanGc, ) -> f64
Sourcepub(crate) fn write(
&self,
cx: SafeJSContext,
global: &GlobalScope,
chunk: SafeHandleValue<'_>,
chunk_size: f64,
can_gc: CanGc,
)
pub(crate) fn write( &self, cx: SafeJSContext, global: &GlobalScope, chunk: SafeHandleValue<'_>, chunk_size: f64, can_gc: CanGc, )
Sourcepub(crate) fn error_if_needed(
&self,
cx: SafeJSContext,
error: SafeHandleValue<'_>,
global: &GlobalScope,
can_gc: CanGc,
)
pub(crate) fn error_if_needed( &self, cx: SafeJSContext, error: SafeHandleValue<'_>, global: &GlobalScope, can_gc: CanGc, )
Sourcefn error(
&self,
stream: &WritableStream,
cx: SafeJSContext,
e: SafeHandleValue<'_>,
global: &GlobalScope,
can_gc: CanGc,
)
fn error( &self, stream: &WritableStream, cx: SafeJSContext, e: SafeHandleValue<'_>, global: &GlobalScope, can_gc: CanGc, )
Trait Implementations§
Source§impl DomObjectWrap<DomTypeHolder> for WritableStreamDefaultController
impl DomObjectWrap<DomTypeHolder> for WritableStreamDefaultController
Source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::GenericBindings::WritableStreamDefaultControllerBinding::WritableStreamDefaultController_Binding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::writablestreamdefaultcontroller::WritableStreamDefaultController>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::writablestreamdefaultcontroller::WritableStreamDefaultController>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::GenericBindings::WritableStreamDefaultControllerBinding::WritableStreamDefaultController_Binding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::writablestreamdefaultcontroller::WritableStreamDefaultController>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::writablestreamdefaultcontroller::WritableStreamDefaultController>>}
Function pointer to the general wrap function type
Source§impl MallocSizeOf for WritableStreamDefaultController
impl MallocSizeOf for WritableStreamDefaultController
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 WritableStreamDefaultControllerMethods<DomTypeHolder> for WritableStreamDefaultController
impl WritableStreamDefaultControllerMethods<DomTypeHolder> for WritableStreamDefaultController
Source§fn Error(
&self,
cx: SafeJSContext,
e: SafeHandleValue<'_>,
realm: InRealm<'_>,
can_gc: CanGc,
)
fn Error( &self, cx: SafeJSContext, e: SafeHandleValue<'_>, realm: InRealm<'_>, can_gc: CanGc, )
impl Eq for WritableStreamDefaultController
Auto Trait Implementations§
impl !Freeze for WritableStreamDefaultController
impl !RefUnwindSafe for WritableStreamDefaultController
impl !Send for WritableStreamDefaultController
impl !Sync for WritableStreamDefaultController
impl Unpin for WritableStreamDefaultController
impl !UnwindSafe for WritableStreamDefaultController
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<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§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