Struct barc::Record [−][src]
pub struct Record {
pub rec_type: RecordType,
pub meta: HeaderMap,
pub req_headers: HeaderMap,
pub req_body: BodyImage,
pub res_headers: HeaderMap,
pub res_body: BodyImage,
}
Expand description
An owned BARC record with public fields.
Additonal getter methods are found in trait implementations
RequestRecorded
, Recorded
,
and MetaRecorded
.
Fields
rec_type: RecordType
Record type.
meta: HeaderMap
Map of meta-headers for values which are not strictly part of the HTTP request or response headers. This can be extended with application specific name/value pairs.
req_headers: HeaderMap
Map of HTTP request headers.
req_body: BodyImage
Request body which may or may not be RAM resident.
res_headers: HeaderMap
Map of HTTP response headers.
res_body: BodyImage
Response body which may or may not be RAM resident.
Trait Implementations
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.
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.
type Error = DialogConvertError
type Error = DialogConvertError
The type returned in the event of a conversion error.
Auto Trait Implementations
impl RefUnwindSafe for Record
impl UnwindSafe for Record
Blanket Implementations
Mutably borrows from an owned value. Read more