You are looking at historical revision 28959 of this page. It may differ significantly from its current revision.
The egg provides facilities to read and write Protocol Buffers in binary format and comes with a plug-in for the protoc compiler that generates CHICKEN code from a .proto definition file.
Most of the time you will run protoc --chicken_out=... on your definition files and import only the generated modules plus the protobuf module from the protobuf library into your code. The generated modules contain SRFI-99 record types for every protocol buffer message type and reflection information used by the (de-)serialization process for every protocol buffer message or enumeration type.
The protobuf library also contains additional modules that allow you to hook into the protocol buffer (de-)serialization process or perform low-level manipulations of the wire format manually.
This module contains the high-level entry points for protocol buffer (de-)serialization and re-exports message?, message-extensions and message-unknown from the protobuf-reflection module.[procedure] (deserialize TYPE [PORT])
Deserializes a binary protocol buffer stream from PORT (or (current-input-port)) into a record of the given TYPE, which must be the SRFI-99 record type descriptor of a protocol buffer message type.[procedure] (serialize MSG [PORT])
Serializes the protocol buffer message MSG to the PORT (or (current-output-port)) as a binary protocol buffer stream. MSG must be a SRFI-99 record instance of a protocol buffer message type.
This module contains the data structures used by the (de-)serialization code to guide its operation. It can also be used for purposes of introspection.[type] type-info
A SRFI-99 record type that serves as the basis for primitive, enumeration or message type descriptors. It contains just an immutable name field.
This abstract type has no constructor.[type] primitive-info
The record type of descriptors for primitive protocol buffer wire types. It contains
- an immutable type field holding the uninterpreted wire type of the primitive,
- an immutable reader field holding a read-like procedure to deserialize an instance of the primitive and
- an immutable writer field holding a write-like procedure to serialize an instance of the primitive.
The record type of descriptors for protocol buffer enumeration types. It contains
- an immutable integer->enum field holding a procedure that converts the integer representation of an enumeration item into a symbol and
- an immutable enum->integer field holding a procedure that converts the symbolic representation of an enumeration item into an integer.
The record type of descriptors for protocol buffer message types. It contains
- an immutable constructor field holding a procedure that creates a new message instance taking only keyword arguments to fill the instance fields,
- an immutable fields field holding a hash table that maps numeric field tags to field information records and
- an immutable required field holding a hash table that maps the numeric tags of required fields to their information records.
The record type of message field descriptors. It contains
- an immutable type field holding a promise,
- an immutable repeated? field holding a boolean,
- an immutable packed? field holding a boolean,
- an immutable accessor field holding a procedure from instances of the containing message type to values of the field, with an optional default argument, and
- an immutable mutator field holding a procedure that sets the field value in an instance of the containing message type.
The type field refers to a SRFI-99 record type descriptor of another protocol buffer message or to an enumeration or primitive type descriptor record. The field-info-type accessor automatically forces the promise contained in this field.[type] message
A SRFI-99 record type that serves as the basis for any protocol buffer message type. It contains
- an immutable extensions field containing a hash table that maps extension tags to their deserialized values and
- a mutable unknown field containing any serial data that could not be interpreted.
This abstract type has no constructor.
Copyright (C) 2013 Thomas Chust <firstname.lastname@example.org>. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.