u-RPC (Python API)
1.0.1
The u-RPC Remote Procedure Call framework
|
Classes | |
class | AllocTable |
The allocation table data structure. More... | |
Functions | |
def | seq_get (seq, index, default=None) |
Get element from sequence by index. More... | |
def | read_data (stream, urpc_type) |
Read data of given type from stream. More... | |
def | read_vary (stream, data_size_type="B") |
Read variable length data from stream. More... | |
def | write_data (stream, data, urpc_type) |
Write data of given type to stream. More... | |
def | write_vary (stream, data, data_size_type="B") |
Write variable length data to stream. More... | |
Variables | |
string | PROMPT_ERR_SPARE_TABLE_ITEM = "Index does not correspond to any value." |
Spare table item error prompt. More... | |
string | PROMPT_ERR_TABLE_FULL = "The table is full." |
Full allocation table prompt. More... | |
_AllocTableItem = namedtuple("_AllocTableItem", ["spare", "next", "data"]) | |
Allocation table item class. More... | |
def urpc.util.read_data | ( | stream, | |
urpc_type | |||
) |
Read data of given type from stream.
stream | Data stream. |
urpc_type | u-RPC data type. |
def urpc.util.read_vary | ( | stream, | |
data_size_type = "B" |
|||
) |
Read variable length data from stream.
stream | Data stream. |
data_size_type | Type of data size in Python's struct module representation. |
def urpc.util.seq_get | ( | seq, | |
index, | |||
default = None |
|||
) |
Get element from sequence by index.
(Fallback to default if index is out of range)
seq | Sequence. |
index | Index of the element. |
default | Fallback default value. |
def urpc.util.write_data | ( | stream, | |
data, | |||
urpc_type | |||
) |
Write data of given type to stream.
stream | Data stream. |
data | Data to write to stream. |
urpc_type | u-RPC data type. |
def urpc.util.write_vary | ( | stream, | |
data, | |||
data_size_type = "B" |
|||
) |
Write variable length data to stream.
stream | Data stream. |
data | Data to write to stream. |
data_size_type | Type of data size in Python's struct module representation. |
|
private |
Allocation table item class.
string urpc.util.PROMPT_ERR_SPARE_TABLE_ITEM = "Index does not correspond to any value." |
Spare table item error prompt.
string urpc.util.PROMPT_ERR_TABLE_FULL = "The table is full." |
Full allocation table prompt.