runtimepy.primitives.serializable
index
/home/vkottler/src/vkottler/workspace/runtimepy/runtimepy/primitives/serializable/__init__.py

A module defining an interface for serializable objects.

 
Package Contents
       
base
fixed
prefixed

 
Classes
       
abc.ABC(builtins.object)
runtimepy.primitives.serializable.base.Serializable
runtimepy.primitives.serializable.fixed.FixedChunk
runtimepy.primitives.serializable.prefixed.PrefixedChunk

 
class FixedChunk(runtimepy.primitives.serializable.base.Serializable)
    FixedChunk(data: bytes, chain: runtimepy.primitives.serializable.base.Serializable = None) -> None
 
A simple fixed-size serializable chunk.
 
 
Method resolution order:
FixedChunk
runtimepy.primitives.serializable.base.Serializable
abc.ABC
builtins.object

Methods defined here:
__bytes__(self) -> bytes
Get this serializable as a bytes instance.
__init__(self, data: bytes, chain: runtimepy.primitives.serializable.base.Serializable = None) -> None
Initialize this instance.
__str__(self) -> str
Get this chunk as a string.
update(self, data: bytes) -> int
Update this serializable from a bytes instance.

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__annotations__ = {}

Methods inherited from runtimepy.primitives.serializable.base.Serializable:
__copy__(self: ~T) -> ~T
Make a copy of this serializable.
add_to_end(self, chain: ~T, array_length: int = None) -> int
Add a new serializable to the end of this chain.
assign(self, chain: ~T) -> int
Assign a next serializable.
copy(self: ~T) -> ~T
Create a copy of a serializable instance.
copy_without_chain(self: ~T) -> ~T
A method for copying instances without chain references.
from_stream(self, stream: <class 'BinaryIO'>) -> int
Update this serializable from a stream.
length(self) -> int
Get the full length of this chain.
length_trace(self) -> str
Get a length-tracing string for this instance.
to_stream(self, stream: <class 'BinaryIO'>) -> int
Write this serializable to a stream.
update_str(self, data: str) -> int
Update this serializable from string data.

Readonly properties inherited from runtimepy.primitives.serializable.base.Serializable:
end
Get the end of this chain.

Data descriptors inherited from runtimepy.primitives.serializable.base.Serializable:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class PrefixedChunk(runtimepy.primitives.serializable.base.Serializable)
    PrefixedChunk(prefix: Union[runtimepy.primitives.int.Uint8Primitive, runtimepy.primitives.int.Uint16Primitive, runtimepy.primitives.int.Uint32Primitive, runtimepy.primitives.int.Uint64Primitive], byte_order: runtimepy.primitives.byte_order.ByteOrder = &lt;ByteOrder.NETWORK: 4&gt;, chain: runtimepy.primitives.serializable.base.Serializable = None) -&gt; None
 
A simple integer-prefixed chunk serializable.
 
 
Method resolution order:
PrefixedChunk
runtimepy.primitives.serializable.base.Serializable
abc.ABC
builtins.object

Methods defined here:
__bytes__(self) -> bytes
Get this serializable as a bytes instance.
__init__(self, prefix: Union[runtimepy.primitives.int.Uint8Primitive, runtimepy.primitives.int.Uint16Primitive, runtimepy.primitives.int.Uint32Primitive, runtimepy.primitives.int.Uint64Primitive], byte_order: runtimepy.primitives.byte_order.ByteOrder = <ByteOrder.NETWORK: 4>, chain: runtimepy.primitives.serializable.base.Serializable = None) -> None
Initialize this instance.
__str__(self) -> str
Get this chunk as a string.
update(self, data: bytes) -> int
Update this serializable from a bytes instance.

Class methods defined here:
create(prefix: Union[type[Union[runtimepy.primitives.int.Int8Primitive, runtimepy.primitives.int.Int16Primitive, runtimepy.primitives.int.Int32Primitive, runtimepy.primitives.int.Int64Primitive, runtimepy.primitives.int.Uint8Primitive, runtimepy.primitives.int.Uint16Primitive, runtimepy.primitives.int.Uint32Primitive, runtimepy.primitives.int.Uint64Primitive, runtimepy.primitives.float.HalfPrimitive, runtimepy.primitives.float.FloatPrimitive, runtimepy.primitives.float.DoublePrimitive, runtimepy.primitives.bool.BooleanPrimitive]], str] = 'uint16', chain: runtimepy.primitives.serializable.base.Serializable = None) -> ~T from abc.ABCMeta
Create a prefixed chunk.

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__annotations__ = {}

Methods inherited from runtimepy.primitives.serializable.base.Serializable:
__copy__(self: ~T) -> ~T
Make a copy of this serializable.
add_to_end(self, chain: ~T, array_length: int = None) -> int
Add a new serializable to the end of this chain.
assign(self, chain: ~T) -> int
Assign a next serializable.
copy(self: ~T) -> ~T
Create a copy of a serializable instance.
copy_without_chain(self: ~T) -> ~T
A method for copying instances without chain references.
from_stream(self, stream: <class 'BinaryIO'>) -> int
Update this serializable from a stream.
length(self) -> int
Get the full length of this chain.
length_trace(self) -> str
Get a length-tracing string for this instance.
to_stream(self, stream: <class 'BinaryIO'>) -> int
Write this serializable to a stream.
update_str(self, data: str) -> int
Update this serializable from string data.

Readonly properties inherited from runtimepy.primitives.serializable.base.Serializable:
end
Get the end of this chain.

Data descriptors inherited from runtimepy.primitives.serializable.base.Serializable:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class Serializable(abc.ABC)
    Serializable(byte_order: runtimepy.primitives.byte_order.ByteOrder = &lt;ByteOrder.NETWORK: 4&gt;, chain: ~T = None) -&gt; None
 
An interface for serializable objects.
 
 
Method resolution order:
Serializable
abc.ABC
builtins.object

Methods defined here:
__bytes__(self) -> bytes
Get this serializable as a bytes instance.
__copy__(self: ~T) -> ~T
Make a copy of this serializable.
__init__(self, byte_order: runtimepy.primitives.byte_order.ByteOrder = <ByteOrder.NETWORK: 4>, chain: ~T = None) -> None
Initialize this instance.
add_to_end(self, chain: ~T, array_length: int = None) -> int
Add a new serializable to the end of this chain.
assign(self, chain: ~T) -> int
Assign a next serializable.
copy(self: ~T) -> ~T
Create a copy of a serializable instance.
copy_without_chain(self: ~T) -> ~T
A method for copying instances without chain references.
from_stream(self, stream: <class 'BinaryIO'>) -> int
Update this serializable from a stream.
length(self) -> int
Get the full length of this chain.
length_trace(self) -> str
Get a length-tracing string for this instance.
to_stream(self, stream: <class 'BinaryIO'>) -> int
Write this serializable to a stream.
update(self, data: bytes) -> int
Update this serializable from a bytes instance.
update_str(self, data: str) -> int
Update this serializable from string data.

Readonly properties defined here:
end
Get the end of this chain.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__abstractmethods__ = frozenset({'__bytes__', '_copy_impl', 'update'})
__annotations__ = {'size': <class 'int'>}

 
Data
        SerializableMap = dict[str, runtimepy.primitives.serializable.base.Serializable]
__all__ = ['Serializable', 'SerializableMap', 'FixedChunk', 'PrefixedChunk']