Lines Matching defs:neighbor
844 // SAFETY: The passed `node` is the current node or a non-null neighbor,
847 // SAFETY: The passed `node` is the current node or a non-null neighbor,
864 self.get_neighbor_raw(direction).map(|neighbor| {
866 // - `neighbor` is a valid tree node.
868 unsafe { Self::to_key_value(neighbor) }
874 let neighbor = unsafe {
881 NonNull::new(neighbor)
952 if let Some(neighbor) = self.get_neighbor_raw(direction) {
953 let neighbor = neighbor.as_ptr();
956 unsafe { bindings::rb_erase(neighbor, addr_of_mut!(self.tree.root)) };
959 let this = unsafe { container_of!(neighbor, Node<K, V>, links) };
979 // - `neighbor` is a valid node in the [`RBTree`] pointed to by `self.tree`.
980 self.get_neighbor_raw(direction).map(|neighbor| Self {
982 current: neighbor,
997 self.get_neighbor_raw(direction).map(|neighbor| {
999 // - `neighbor` is a valid tree node.
1001 unsafe { Self::to_key_value(neighbor) }
1016 self.get_neighbor_raw(direction).map(|neighbor| {
1018 // - `neighbor` is a valid tree node.
1020 unsafe { Self::to_key_value_mut(neighbor) }
1026 let neighbor = unsafe {
1033 NonNull::new(neighbor)
1066 // SAFETY: The passed `node` is the current node or a non-null neighbor,
1069 // SAFETY: The passed `node` is the current node or a non-null neighbor,