pub struct BodyChunk {
pub received: bool,
pub end_of_stream: bool,
pub size: u64,
pub start: u64,
pub content: Vec<u8>,
}
Expand description
The first chunk of an HTTP body.
Bulwark does not send the entire body to the guest plugin environment. This limitation limits the impact of copying a large number of bytes from the host into guest VMs. A full body copy would be required for each plugin for every request or response otherwise.
This has consequences for any plugin that wants to parse the body it receives. Some data formats like JSON
may be significantly more difficult to work with if only partially received, and streaming parsers which may be
more tolerant to trunctation are recommended in such cases. There will be some situations where this limitation
prevents useful parsing entirely and plugins may need to make use of the unknown
result value to express this.
Fields§
§received: bool
§end_of_stream: bool
§size: u64
§start: u64
§content: Vec<u8>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BodyChunk
impl RefUnwindSafe for BodyChunk
impl Send for BodyChunk
impl Sync for BodyChunk
impl Unpin for BodyChunk
impl UnwindSafe for BodyChunk
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