---
title: llarp/service/pendingbuffer.hpp

---

# llarp/service/pendingbuffer.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::service](Namespaces/namespacellarp_1_1service.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::service::PendingBuffer](Classes/structllarp_1_1service_1_1PendingBuffer.md)**  |




## Source code

```cpp
#pragma once

#include "protocol.hpp"
#include <llarp/util/buffer.hpp>

#include <algorithm>
#include <iterator>
#include <vector>

namespace llarp
{
  namespace service
  {
    struct PendingBuffer
    {
      std::vector<byte_t> payload;
      ProtocolType protocol;

      PendingBuffer(const llarp_buffer_t& buf, ProtocolType t) : payload(buf.sz), protocol(t)
      {
        std::copy(buf.base, buf.base + buf.sz, std::back_inserter(payload));
      }

      ManagedBuffer
      Buffer()
      {
        return ManagedBuffer{llarp_buffer_t(payload)};
      }
    };
  }  // namespace service

}  // namespace llarp
```


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

Updated on 2022-08-30 at 18:09:28 +0000
