Problem with writing BoltDb in Rust about reference

I try to rewrite boltdb in rust for learning. I reference to nut, then I found struct like this :

pub(crate) struct NodeInner {
/// associated bucket
pub(super) bucket: *const Bucket,
/// is node is leaf element
pub(super) is_leaf: AtomicBool,
............
}

I dislike raw point used here because I think it is not in Rust style. So I try to use reference like

pub(crate) struct NodeInner {
pub(super) bucket:&'a Bucket
...
}

then I have to propogate lifetime identifier 'a every where. Finally I don't know how to let cargo check no errros. I can not cope with so many 'a.
Is it necessary to use raw pointer here?
How to organize data struct in boltdb like node,page,tx,bucket in a Rust style?

Please fix your formatting.

That is definitely not true. In many cases, having a raw pointer is perfectly acceptable - particularly in low-level library code. I am not saying that this cannot be replaced with references (I haven't read the code, so I can't say).

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.