forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serializer.cc
38 lines (28 loc) · 812 Bytes
/
serializer.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Copyright (C) 2021-present ScyllaDB
*/
/*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include "serializer_impl.hh"
namespace ser {
logging::logger serlog("serializer");
} // namespace ser
namespace utils {
managed_bytes_view
buffer_view_to_managed_bytes_view(ser::buffer_view<bytes_ostream::fragment_iterator> bv) {
auto impl = bv.extract_implementation();
return build_managed_bytes_view_from_internals(
impl.current,
impl.next.extract_implementation().current_chunk,
impl.size
);
}
managed_bytes_view_opt
buffer_view_to_managed_bytes_view(std::optional<ser::buffer_view<bytes_ostream::fragment_iterator>> bvo) {
if (!bvo) {
return std::nullopt;
}
return buffer_view_to_managed_bytes_view(*bvo);
}
} // namespace utils