pub struct Node<T: Clone> {
pub key: TextRange,
pub val: T,
/* private fields */
}
Fields§
§key: TextRange
§val: T
Implementations§
Source§impl<T: Clone> Node<T>
impl<T: Clone> Node<T>
pub fn red(node: &MaybeNode<T>) -> bool
pub fn new(key: TextRange, val: T, is_right_child: bool) -> Node<T>
pub fn new_boxed(key: TextRange, val: T, is_right_child: bool) -> BoxedNode<T>
Sourcepub fn rotate_left(node: &mut BoxedNode<T>) -> Option<&mut BoxedNode<T>>
pub fn rotate_left(node: &mut BoxedNode<T>) -> Option<&mut BoxedNode<T>>
perform the following operation, \ is the red link:
| |
n x
/ \ //
x => n
/ \ /
c c
Sourcepub fn rotate_right(node: &mut BoxedNode<T>) -> Option<&mut BoxedNode<T>>
pub fn rotate_right(node: &mut BoxedNode<T>) -> Option<&mut BoxedNode<T>>
perform the following operation, \ is the red link:
| |
n x
// \ / \
x => n
/ \ /
c c
pub fn get_node(&self, key: TextRange) -> Option<&Node<T>>
pub fn insert_at<'a, F: Fn(T, T) -> T>( node: &'a mut MaybeNode<T>, key: TextRange, val: T, is_right_child: bool, merge_fn: &F, ) -> Option<&'a mut BoxedNode<T>>
pub fn find_intersects<'a>( &'a self, range: TextRange, results: &mut Vec<&'a Node<T>>, )
pub fn advance(&mut self, position: usize, length: usize)
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Node<T>where
T: Freeze,
impl<T> RefUnwindSafe for Node<T>where
T: RefUnwindSafe,
impl<T> Send for Node<T>where
T: Send,
impl<T> Sync for Node<T>where
T: Sync,
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> UnwindSafe for Node<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more