Hacker News new | past | comments | ask | show | jobs | submit login

I am not familiar with this crate, but I am with Rust, here’s my take:

Copy is a specific thing in Rust, it means that if a type implements the Copy trait, it can be copied via a memcpy, that is, it’s like a “shallow” copy as opposed to a “deep” copy.

So they’re not “copying without copying”, they’re letting you treat a non-Copy type as a Copy type, in my understanding.

> what if it’s something that doesn’t have a static lifetime?

The read me says it requires static content so the answer is “you can’t do that.”




Could you use position-independent internal references (relative pointers) to make data copyable? Does Rust have good support for that?


Rust does not have native support for relative pointers, so you'd have to hack that together with unsafe. It's not generally done.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: