## Serializable


Abstract base class for serializable objects.


Usage


``` python
Serializable()
```


Subclasses must implement [to_bytes](Serializable.md#gdtest_protocols.Serializable.to_bytes) and [from_bytes](Serializable.md#gdtest_protocols.Serializable.from_bytes).


## Methods

| Name | Description |
|----|----|
| [from_bytes()](#from_bytes) | Deserialize from bytes. |
| [size()](#size) | Get the serialized size. |
| [to_bytes()](#to_bytes) | Serialize this object to bytes. |

------------------------------------------------------------------------


#### from_bytes()


Deserialize from bytes.


Usage


``` python
from_bytes(data)
```


##### Parameters


`data: bytes`  
The bytes to deserialize.


##### Returns


`Serializable`  
A new instance.


------------------------------------------------------------------------


#### size()


Get the serialized size.


Usage


``` python
size()
```


##### Returns


`int`  
Size in bytes.


------------------------------------------------------------------------


#### to_bytes()


Serialize this object to bytes.


Usage


``` python
to_bytes()
```


##### Returns


`bytes`  
The serialized representation.
