Try using the -dip25 switch to dmd, it does one more step in D toward making a borrow thingy. Nowhere near the level Rust does it, but combined with other library things like destructors, prohibiting copying, etc., it can kinda make a owned thing with borrowed bits.
I really wish we don't move that way. dip25 is at best a glorious hack and the kind of things that incrase language complexity without giving much in return.