Amanieu / intrusive-rs

Intrusive collections for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

JunichiSugiura opened this issue · comments

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.

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?

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.