Struct body_image::Dialog [−][src]
pub struct Dialog { /* fields omitted */ }
An HTTP request and response recording.
Note that several important getter methods for Dialog
are found in trait
implementations RequestRecorded
and
Recorded
.
Methods
impl Dialog
[src]
impl Dialog
pub fn method(&self) -> &Method
[src]
pub fn method(&self) -> &Method
The HTTP method (verb), e.g. GET
, POST
, etc.
pub fn url(&self) -> &Uri
[src]
pub fn url(&self) -> &Uri
The complete URL as used in the request.
pub fn req_body_mut(&mut self) -> &mut BodyImage
[src]
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
.
pub fn res_status(&self) -> StatusCode
[src]
pub fn res_status(&self) -> StatusCode
The response status code.
pub fn res_version(&self) -> Version
[src]
pub fn res_version(&self) -> Version
The response HTTP version.
pub fn res_decoded(&self) -> &Vec<Encoding>
[src]
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.
pub fn res_body_mut(&mut self) -> &mut BodyImage
[src]
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
.
Trait Implementations
impl TryFrom<Dialog> for Record
[src]
impl TryFrom<Dialog> for Record
type Err = BarcError
fn try_from(dialog: Dialog) -> Result<Self, Self::Err>
[src]
fn try_from(dialog: Dialog) -> Result<Self, Self::Err>
Attempt to convert Dialog
to Record
. This derives meta headers
from various Dialog
fields, and could potentially fail, based on
header value constraints, with BarcError::InvalidHeader
. Converting
Dialog::url
to the meta url header has the most potential, given
http::Uri
validation complexity, but any conversion failure would
suggest an http crate bug or breaking change—as currently stated,
allowed Uri
bytes are a subset of allowed HeaderValue
bytes.
impl TryFrom<Record> for Dialog
[src]
impl TryFrom<Record> for Dialog
type Err = DialogConvertError
fn try_from(rec: Record) -> Result<Self, Self::Err>
[src]
fn try_from(rec: Record) -> Result<Self, Self::Err>
Attempt to convert Record
to Dialog
. This parses various meta
header values to produce Dialog
equivalents such as
http::StatusCode
and http::Method
, which could fail, if the
Record
was not originally produced from a Dialog
or was otherwise
modified in an unsupported way.
impl Clone for Dialog
[src]
impl Clone for Dialog
fn clone(&self) -> Dialog
[src]
fn clone(&self) -> Dialog
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Dialog
[src]
impl Debug for Dialog
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl RequestRecorded for Dialog
[src]
impl RequestRecorded for Dialog
fn req_headers(&self) -> &HeaderMap
[src]
fn req_headers(&self) -> &HeaderMap
Map of HTTP request headers.
fn req_body(&self) -> &BodyImage
[src]
fn req_body(&self) -> &BodyImage
Request body (e.g for HTTP POST, etc.) which may or may not be RAM resident. Read more
impl Recorded for Dialog
[src]
impl Recorded for Dialog