Dialog

Struct Dialog 

Source
pub struct Dialog { /* private fields */ }
Expand description

An HTTP request and response recording.

This composed type has private fields but offers getters, mutable getters and setter methods. Several important getter methods are found in trait implementations RequestRecorded and Recorded.

It may be constructed via the Prolog and Epilog public structs and the explode method can be used to extract the same.

Implementations§

Source§

impl Dialog

Source

pub fn new(pro: Prolog, epi: Epilog) -> Dialog

Construct from a Prolog and Epilog.

Source

pub fn method(&self) -> &Method

The HTTP method (verb), e.g. GET, POST, etc.

Source

pub fn url(&self) -> &Uri

The complete URL as used in the request.

Source

pub fn req_body_mut(&mut self) -> &mut BodyImage

A mutable reference to the request body. This is primarly provided to allow state mutating operations such as BodyImage::mem_map.

Source

pub fn res_status(&self) -> StatusCode

The response status code.

Source

pub fn res_version(&self) -> Version

The response HTTP version.

Source

pub fn res_decoded(&self) -> &Vec<Encoding>

A list of encodings that were removed (decoded) to provide this representation of the response body (res_body). May be empty.

Source

pub fn set_res_decoded(&mut self, decoded: Vec<Encoding>)

Set a new response decoded list.

Source

pub fn res_body_mut(&mut self) -> &mut BodyImage

A mutable reference to the response body. This is primarly provided to allow state mutating operations such as BodyImage::mem_map.

Source

pub fn set_res_body_decoded(&mut self, body: BodyImage, decoded: Vec<Encoding>)

Set a new response body and decoded vector.

Source

pub fn explode(self) -> (Prolog, Epilog)

Consume self, exploding into a (Prolog, Epilog) tuple (each with public fields).

Trait Implementations§

Source§

impl Clone for Dialog

Source§

fn clone(&self) -> Dialog

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Dialog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Recorded for Dialog

Source§

fn res_headers(&self) -> &HeaderMap

Map of HTTP response headers.
Source§

fn res_body(&self) -> &BodyImage

Response body which may or may not be RAM resident.
Source§

impl RequestRecorded for Dialog

Source§

fn req_headers(&self) -> &HeaderMap

Map of HTTP request headers.
Source§

fn req_body(&self) -> &BodyImage

Request body (e.g for HTTP POST, etc.) which may or may not be RAM resident.

Auto Trait Implementations§

§

impl !Freeze for Dialog

§

impl RefUnwindSafe for Dialog

§

impl Send for Dialog

§

impl Sync for Dialog

§

impl Unpin for Dialog

§

impl UnwindSafe for Dialog

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V