struct ExternalUnderlyingSourceController {
buffer: RefCell<Vec<u8>>,
closed: Cell<bool>,
in_memory: Cell<bool>,
}
Fields§
§buffer: RefCell<Vec<u8>>
Loosely matches the underlying queue, https://streams.spec.whatwg.org/#internal-queues
closed: Cell<bool>
Has the stream been closed by native code?
in_memory: Cell<bool>
Does this stream contains all it’s data in memory?
Implementations§
source§impl ExternalUnderlyingSourceController
impl ExternalUnderlyingSourceController
fn new(source: ExternalUnderlyingSource) -> ExternalUnderlyingSourceController
sourcepub fn get_in_memory_bytes(&self) -> Option<Vec<u8>>
pub fn get_in_memory_bytes(&self) -> Option<Vec<u8>>
Return bytes synchronously if the stream has all data in memory.
sourcefn maybe_signal_available_bytes(
&self,
cx: SafeJSContext,
stream: HandleObject,
available: usize
)
fn maybe_signal_available_bytes( &self, cx: SafeJSContext, stream: HandleObject, available: usize )
Signal available bytes if the stream is currently readable.
sourcefn maybe_close_js_stream(&self, cx: SafeJSContext, stream: HandleObject)
fn maybe_close_js_stream(&self, cx: SafeJSContext, stream: HandleObject)
Close a currently readable js stream.
fn close(&self, cx: SafeJSContext, stream: HandleObject)
fn enqueue_chunk(&self, cx: SafeJSContext, stream: HandleObject, chunk: Vec<u8>)
fn pull(&self, cx: SafeJSContext, stream: HandleObject, _desired_size: usize)
fn get_chunk_with_length(&self, length: usize) -> Vec<u8> ⓘ
fn write_into_buffer(&self, dest: &mut [u8])
Trait Implementations§
source§impl MallocSizeOf for ExternalUnderlyingSourceController
impl MallocSizeOf for ExternalUnderlyingSourceController
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.
Auto Trait Implementations§
impl !RefUnwindSafe for ExternalUnderlyingSourceController
impl Send for ExternalUnderlyingSourceController
impl !Sync for ExternalUnderlyingSourceController
impl Unpin for ExternalUnderlyingSourceController
impl UnwindSafe for ExternalUnderlyingSourceController
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<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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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