mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
Extend Rust FFI
Do idiomatic C++ copy and move constructors for a few things, so wrapping structs' defaults can work.
This commit is contained in:
parent
eb1911e277
commit
e433d4af4c
8 changed files with 63 additions and 21 deletions
|
@ -64,6 +64,13 @@ pub extern "C" fn ffi_StorePath_clone(self_: &StorePath) -> StorePath {
|
|||
self_.clone()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn ffi_StorePath_clone_to(self_: &StorePath, other: *mut StorePath) {
|
||||
unsafe {
|
||||
core::ptr::write(other, self_.clone());
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn ffi_StorePath_name(self_: &StorePath) -> &str {
|
||||
self_.name.name()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue