Amanieu / intrusive-rs

Intrusive collections for Rust
Apache License 2.0
412 stars 48 forks source link

RBTree: How to get parent node based on current cursor? #68

Open JunichiSugiura opened 2 years ago

JunichiSugiura commented 2 years ago

I'm looking for a way to bubble up cache changes in node to its ancestors all the way to the root in RBTree. I see there's .parent() method in rbtree::AtomicLinkOps but I'm not sure how to access it from Cursor.

Amanieu commented 2 years ago

The parent node isn't really exposed in the RBTree interface because the RBTree API exposes the data structure as a linear sequence of ordered values. The internal tree structure is hidden.

What exactly are you trying to achieve with this?

JunichiSugiura commented 2 years ago

Hi, @Amanieu. Thanks for the response. I'm trying to re-implement VSCode's buffer implementation in Rust. It requires some low-level tree manipulation logic it seems.