mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
22 lines
429 B
C++
22 lines
429 B
C++
#include "logging.hh"
|
|
#include "rust-ffi.hh"
|
|
|
|
extern "C" std::exception_ptr * make_error(rust::StringSlice s)
|
|
{
|
|
return new std::exception_ptr(std::make_exception_ptr(nix::Error(std::string(s.ptr, s.size))));
|
|
}
|
|
|
|
extern "C" void destroy_error(std::exception_ptr * ex)
|
|
{
|
|
free(ex);
|
|
}
|
|
|
|
namespace rust {
|
|
|
|
std::ostream & operator << (std::ostream & str, const String & s)
|
|
{
|
|
str << (std::string_view) s;
|
|
return str;
|
|
}
|
|
|
|
}
|