---
title: llarp::dns::Serialize
summary: base type for serializable dns entities 

---

# llarp::dns::Serialize



base type for serializable dns entities 


`#include <serialize.hpp>`

Inherited by [llarp::dns::Message](Classes/structllarp_1_1dns_1_1Message.md), [llarp::dns::MessageHeader](Classes/structllarp_1_1dns_1_1MessageHeader.md), [llarp::dns::Question](Classes/structllarp_1_1dns_1_1Question.md), [llarp::dns::ResourceRecord](Classes/structllarp_1_1dns_1_1ResourceRecord.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| virtual | **[~Serialize](Classes/structllarp_1_1dns_1_1Serialize.md#function-~serialize)**() =0 |
| virtual bool | **[Encode](Classes/structllarp_1_1dns_1_1Serialize.md#function-encode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const =0<br>encode entity to buffer  |
| virtual bool | **[Decode](Classes/structllarp_1_1dns_1_1Serialize.md#function-decode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) =0<br>decode entity from buffer  |
| virtual util::StatusObject | **[ToJSON](Classes/structllarp_1_1dns_1_1Serialize.md#function-tojson)**() const =0<br>convert this whatever into json  |

## Public Functions Documentation

### function ~Serialize

```cpp
virtual ~Serialize() =0
```


### function Encode

```cpp
virtual bool Encode(
    llarp_buffer_t * buf
) const =0
```

encode entity to buffer 

**Reimplemented by**: [llarp::dns::MessageHeader::Encode](Classes/structllarp_1_1dns_1_1MessageHeader.md#function-encode), [llarp::dns::Message::Encode](Classes/structllarp_1_1dns_1_1Message.md#function-encode), [llarp::dns::Question::Encode](Classes/structllarp_1_1dns_1_1Question.md#function-encode), [llarp::dns::ResourceRecord::Encode](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-encode)


### function Decode

```cpp
virtual bool Decode(
    llarp_buffer_t * buf
) =0
```

decode entity from buffer 

**Reimplemented by**: [llarp::dns::MessageHeader::Decode](Classes/structllarp_1_1dns_1_1MessageHeader.md#function-decode), [llarp::dns::Message::Decode](Classes/structllarp_1_1dns_1_1Message.md#function-decode), [llarp::dns::Question::Decode](Classes/structllarp_1_1dns_1_1Question.md#function-decode), [llarp::dns::ResourceRecord::Decode](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-decode)


### function ToJSON

```cpp
virtual util::StatusObject ToJSON() const =0
```

convert this whatever into json 

**Reimplemented by**: [llarp::dns::MessageHeader::ToJSON](Classes/structllarp_1_1dns_1_1MessageHeader.md#function-tojson), [llarp::dns::Message::ToJSON](Classes/structllarp_1_1dns_1_1Message.md#function-tojson), [llarp::dns::Question::ToJSON](Classes/structllarp_1_1dns_1_1Question.md#function-tojson), [llarp::dns::ResourceRecord::ToJSON](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-tojson)


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

Updated on 2023-01-24 at 18:23:42 +0000