Fastly Compute C++ SDK
Loading...
Searching...
No Matches
access_bridge_internals.h
Go to the documentation of this file.
1#ifndef FASTLY_ACCESS_BRIDGE_INTERNALS_H
2#define FASTLY_ACCESS_BRIDGE_INTERNALS_H
3
4#include <fastly/sdk-sys.h>
5
6namespace fastly::detail {
7// This type can be used to access the inner `rust::Box` of
8// various wrapper types in the C++ SDK.
9// It can also be used to construct wrapper types from raw pointers.
10// This is intended for internal use only.
12 template <class T> static auto &get(T &obj) { return obj.inner(); }
13 template <class T> static auto &get(const T &obj) { return obj.inner(); }
14 template <class T, class U> static auto from_raw(U *ptr) {
15 return T(rust::Box<U>::from_raw(ptr));
16 }
17};
18} // namespace fastly::detail
19
20#endif
Definition access_bridge_internals.h:6
Definition access_bridge_internals.h:11
static auto & get(const T &obj)
Definition access_bridge_internals.h:13
static auto & get(T &obj)
Definition access_bridge_internals.h:12
static auto from_raw(U *ptr)
Definition access_bridge_internals.h:14