Expand description
Body Archive container file format, reader and writer.
BARC is a container file format for the storage or one to many HTTP
request/response dialog records. A fixed length, ASCII-only record head
specifies lengths of a subsequent series of request and response header
blocks and bodies which are stored as raw (unencoded) bytes. When not
using the internal compression feature, the format is easily human
readable. With compression, the barc
CLI tool (barc-cli crate) can be
used to view records.
See some sample files in source sample/*.barc.
Other features:
-
An additional meta-headers block provides more recording details and can also be used to store application-specific values.
-
Sequential or random-access reads by record offset (which could be stored in an external index or database).
-
Single-writer sessions are guaranteed safe with N concurrent readers (in or out of process).
-
Optional per-record gzip or Brotli compression (headers and bodies)
Structs
Path
, supporting up to 1 writer and N
readers concurrently.Plain
) compression.Enums
Record
to a
Dialog
. This may be extended in the future, so exhaustive matching is
gently discouraged with an unused variant.Write
reference for the
underlying BARC File
reference.Constants
Traits
Record
compatible objects by reference, extending
Recorded
with meta-headers and a record type.TryFrom
trait proposed but not yet available in std
.TryInto
trait proposed but not yet available in
std
. Blanket implemented for all TryFrom
.Functions
HeaderName
for the HTTP method used in the request, e.g. “GET”,
“POST”, etc.HeaderName
for a list of content or transfer encodings decoded for
the current response body. The value is in HTTP content-encoding header
format, e.g. “chunked, gzip”.HeaderName
for the response numeric status code, SPACE, and then a
standardized reason phrase, e.g. “200 OK”. The later is intended only
for human readers.HeaderName
for the response version, e.g. “HTTP/1.1”, “HTTP/2.0”,
etc.HeaderName
for the complete URL used in the request.BarcWriter
, but
is made public for its general diagnostic utility.BarcWriter
,
but is made public for its general diagnostic utility.