struct TransmitBodyConnectHandler {
body: SendableBody,
bytes_sender: Option<IpcSender<BodyChunkResponse>>,
}Expand description
The IPC route handler for https://fetch.spec.whatwg.org/#concept-request-transmit-body. This route runs in the script process, and will queue tasks to perform operations on the stream and transmit body chunks over IPC.
Fields§
§body: SendableBody§bytes_sender: Option<IpcSender<BodyChunkResponse>>Implementations§
Source§impl TransmitBodyConnectHandler
impl TransmitBodyConnectHandler
fn new(body: SendableBody) -> TransmitBodyConnectHandler
Sourcefn reset_in_memory_done(&mut self)
fn reset_in_memory_done(&mut self)
Reset the done flag when this is an in-memory body, called when a stream is
re-extracted from the source to support a re-direct.
Sourcefn re_extract(&mut self, chunk_request_receiver: IpcReceiver<BodyChunkRequest>)
fn re_extract(&mut self, chunk_request_receiver: IpcReceiver<BodyChunkRequest>)
Re-extract the source to support streaming it again for a re-direct. TODO: actually re-extract the source, instead of just cloning data, to support Blob.
Sourcefn transmit_source(&mut self)
fn transmit_source(&mut self)
In case of re-direct, and of a source available in memory, send it all in one chunk.
TODO: this method should be deprecated
in favor of making re_extract actually re-extract a stream from the source.
See #26686
Sourcefn start_reading(&mut self, sender: IpcSender<BodyChunkResponse>)
fn start_reading(&mut self, sender: IpcSender<BodyChunkResponse>)
Take the IPC sender sent by net, so we can send body chunks with it.
Also the entry point to https://fetch.spec.whatwg.org/#concept-request-transmit-body
Sourcefn stop_reading(&mut self)
fn stop_reading(&mut self)
Take and drop Self::bytes_sender.
Sourcefn transmit_body_chunk(&mut self)
fn transmit_body_chunk(&mut self)
Step 4 and following of https://fetch.spec.whatwg.org/#concept-request-transmit-body
Trait Implementations§
Source§impl Clone for TransmitBodyConnectHandler
impl Clone for TransmitBodyConnectHandler
Source§fn clone(&self) -> TransmitBodyConnectHandler
fn clone(&self) -> TransmitBodyConnectHandler
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TransmitBodyConnectHandler
impl !Sync for TransmitBodyConnectHandler
impl !UnwindSafe for TransmitBodyConnectHandler
impl Freeze for TransmitBodyConnectHandler
impl Send for TransmitBodyConnectHandler
impl Unpin for TransmitBodyConnectHandler
impl UnsafeUnpin for TransmitBodyConnectHandler
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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 more