2019-09-10 23:15:20 +00:00
|
|
|
#include "logging.hh"
|
2019-09-11 11:10:46 +00:00
|
|
|
#include "rust-ffi.hh"
|
2019-09-10 23:15:20 +00:00
|
|
|
|
|
|
|
extern "C" std::exception_ptr * make_error(rust::StringSlice s)
|
|
|
|
{
|
|
|
|
// FIXME: leak
|
2019-12-05 18:11:09 +00:00
|
|
|
return new std::exception_ptr(std::make_exception_ptr(nix::Error(std::string(s.ptr, s.size))));
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace rust {
|
|
|
|
|
|
|
|
std::ostream & operator << (std::ostream & str, const String & s)
|
|
|
|
{
|
|
|
|
str << (std::string_view) s;
|
|
|
|
return str;
|
2019-09-10 23:15:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|