slot_size
Behaviour
Section titled “Behaviour”- Return the number of bytes the object in the specified slot occupies when serialized
- Retrieves the size of the specified slot.
Definition
Section titled “Definition”int64_t slot_size ( uint32_t slot_no);function slot_size(slotno: number): ErrorCode | numberExample
Section titled “Example”int64_t bytes_needed = slot_size(1); // get size of slot 1const bytes_needed = slot_size(1); // get size of slot 1Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| slot_no | uint32_t | The slot number |
| Name | Type | Description |
|---|---|---|
| slotno | number | The slot number to check the size of. |
Return Code
Section titled “Return Code”| Type | Description |
|---|---|
| int64_t | The number of bytes the object occupies when serialized |
| Type | Description |
|---|---|
| ErrorCode | number | Returns an error code or the size of the slot. |