sync_stream_interface.h
1 // Copyright 2020, Beeri 15. All rights reserved.
2 // Author: Roman Gershman (romange@gmail.com)
3 //
4 
5 #pragma once
6 
7 #include <sys/uio.h>
8 #include "base/expected.hpp"
9 
10 namespace util {
11 
13 public:
14  using expected_size_t = nonstd::expected<size_t, std::error_code>;
15 
16  virtual ~SyncStreamInterface() {}
17  virtual expected_size_t Send(const iovec* ptr, size_t len) = 0;
18  virtual expected_size_t Recv(iovec* ptr, size_t len) = 0;
19 };
20 
21 } // namespace util