lokinet/llarp/service/pendingbuffer.hpp

27 lines
437 B
C++
Raw Normal View History

#pragma once
2019-04-19 16:02:32 +00:00
#include "protocol.hpp"
#include <llarp/util/buffer.hpp>
2019-04-19 16:02:32 +00:00
#include <vector>
namespace llarp::service
2019-04-19 16:02:32 +00:00
{
struct PendingBuffer
2019-04-19 16:02:32 +00:00
{
std::vector<byte_t> payload;
ProtocolType protocol;
2019-04-19 16:02:32 +00:00
inline llarp_buffer_t
Buffer()
{
return llarp_buffer_t{payload};
}
2019-04-19 16:02:32 +00:00
PendingBuffer(const llarp_buffer_t& buf, ProtocolType t) : payload{buf.copy()}, protocol{t}
{}
};
2019-04-19 16:02:32 +00:00
} // namespace llarp::service