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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Record type.

Map of meta-headers for values which are not strictly part of the HTTP request or response headers. Read more

Map of HTTP response headers.

Response body which may or may not be RAM resident.

Map of HTTP request headers.

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

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.

The type returned in the event of a conversion error.

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.

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.