|
|
|
|
|
by meltyness
495 days ago
|
|
Seems like the preferred interface would be a purely functional block that provides the access. Obviously forcing callers to free means adding lints and docs. Returning borrows leaves the likelihood of entering into explicit lifetimes hell and such in calling code. A functional interface like (paraphrasing) // pub fn apply_op(&mut self, FnMut(&mut T, &bindings::dma_addr_t... ))
Keeps pandora inside the box. |
|
Just like `Box::into_raw`, this method shouldn't be used in pure Rust code. It's only available for C FFI.