pub struct PluginHttpResponse { /* private fields */ }Expand description
Bounded response returned by a host-owned request broker.
Implementations§
Source§impl PluginHttpResponse
impl PluginHttpResponse
Sourcepub fn new(
status: u16,
final_url: Url,
body: Vec<u8>,
) -> Result<Self, PluginError>
pub fn new( status: u16, final_url: Url, body: Vec<u8>, ) -> Result<Self, PluginError>
Creates a response with no headers and exact retained/delivered length.
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, PluginError>
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Result<Self, PluginError>
Adds one bounded response header.
Sourcepub fn with_capture_metadata(
self,
delivered_body_bytes: u64,
body_truncated: bool,
) -> Result<Self, PluginError>
pub fn with_capture_metadata( self, delivered_body_bytes: u64, body_truncated: bool, ) -> Result<Self, PluginError>
Sets delivered-byte accounting and truncation state reported by the host.
Sourcepub const fn delivered_body_bytes(&self) -> u64
pub const fn delivered_body_bytes(&self) -> u64
Bytes delivered by the broker before retention stopped.
Sourcepub const fn body_truncated(&self) -> bool
pub const fn body_truncated(&self) -> bool
Whether the host truncated retention.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginHttpResponse
impl RefUnwindSafe for PluginHttpResponse
impl Send for PluginHttpResponse
impl Sync for PluginHttpResponse
impl Unpin for PluginHttpResponse
impl UnsafeUnpin for PluginHttpResponse
impl UnwindSafe for PluginHttpResponse
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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