zoonado.protocol.primitives
¶zoonado.protocol.primitives.
Primitive
(value)[source]¶The most basic structure of the protocol. Subclassed, never used directly.
Used as a building block for the various actually-used primitives outlined in the Zookeeper jute file:
https://github.com/apache/zookeeper/blob/trunk/src/zookeeper.jute
zoonado.protocol.primitives.
VariablePrimitive
(value)[source]¶Base primitive for variable-length scalar primitives (strings and bytes).
render
()[source]¶Returns the struct
format and list of the size and value.
The format is derived from the size primitive and the length of the resulting encoded value (e.g. the format for a string of ‘foo’ ends up as ‘h3s’.
Note
The value is expected to be string-able (wrapped in str()
) and is
then encoded as UTF-8.
zoonado.protocol.primitives.
Bool
(value)[source]¶Represents a boolean (true or false) value.
Renders as an unsigned char (1 byte).
zoonado.protocol.primitives.
Float
(value)[source]¶Represents a single-precision floating poing conforming to IEEE 754.
zoonado.protocol.primitives.
Double
(value)[source]¶Represents a double-precision floating poing conforming to IEEE 754.
zoonado.protocol.primitives.
UString
(value)[source]¶Represents a unicode string value, length denoted by a 32-bit integer.
zoonado.protocol.primitives.
Buffer
(value)[source]¶Represents a bytestring value, length denoted by a 32-bit signed integer.
zoonado.protocol.primitives.
Vector
(value)[source]¶Represents an array of any arbitrary Primitive
or Part
.
Not used directly but rather by its of()
classmethod to denote an
Vector.of(<something>)
.