pub struct RequestBody {
body_chunk_request_channel: Arc<Mutex<Option<IpcSender<BodyChunkRequest>>>>,
source: BodySource,
total_bytes: Option<usize>,
}Expand description
A process local view into https://fetch.spec.whatwg.org/#bodies. After IPC serialization, each process gets its own shared sender state for the same body stream. the net side fetch entry points own clearing their local copy once that fetch invocation reaches its terminal state. Redirect replay can later deserialize a fresh “RequestBody”, so lower level fetch steps cannot always clean up immediately.
Fields§
§body_chunk_request_channel: Arc<Mutex<Option<IpcSender<BodyChunkRequest>>>>Net’s channel to communicate with script re this body.
source: BodySource§total_bytes: Option<usize>Implementations§
Source§impl RequestBody
impl RequestBody
pub fn new( body_chunk_request_channel: IpcSender<BodyChunkRequest>, source: BodySource, total_bytes: Option<usize>, ) -> Self
Sourcepub fn extract_source(&mut self)
pub fn extract_source(&mut self)
Sourcepub fn clone_stream(&self) -> Arc<Mutex<Option<IpcSender<BodyChunkRequest>>>>
pub fn clone_stream(&self) -> Arc<Mutex<Option<IpcSender<BodyChunkRequest>>>>
This is the current process shared optional sender for requesting body chunks.
Sourcepub fn close_stream(&self)
pub fn close_stream(&self)
Clears the current process shared sender state for this “RequestBody” copy.
This does not notify or mutate other deserialized “RequestBody” values in other processes. Can be called multiple times.
pub fn source_is_null(&self) -> bool
pub fn len(&self) -> Option<usize>
Trait Implementations§
Source§impl Clone for RequestBody
impl Clone for RequestBody
Source§fn clone(&self) -> RequestBody
fn clone(&self) -> RequestBody
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestBody
impl Debug for RequestBody
Source§impl<'de> Deserialize<'de> for RequestBody
impl<'de> Deserialize<'de> for RequestBody
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl MallocSizeOf for RequestBody
impl MallocSizeOf for RequestBody
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 Freeze for RequestBody
impl !RefUnwindSafe for RequestBody
impl Send for RequestBody
impl Sync for RequestBody
impl Unpin for RequestBody
impl !UnwindSafe for RequestBody
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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