You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: events_measurer.rs
    path of file: ./repos/freya/crates/core/src/events
    
    the code of the file until where you have to start completion: use crate::layout::{Layers, Viewports};
use dioxus_native_core::real_dom::NodeImmutable;
use dioxus_native_core::NodeId;
use dioxus_native_core::{prelude::NodeImmutableDioxusExt, tree::TreeRef};
use freya_dom::{dom::DioxusDOM, prelude::FreyaDOM};

use freya_engine::prelude::*;
use freya_node_state::{Fill, Style};

pub use crate::events::{DomEvent, NodesState, PlatformEvent};

use crate::types::{EventEmitter, EventsQueue, PotentialEvents};

use super::pot
    
fn is_node_parent_of(rdom: &DioxusDOM, node: NodeId, parent_node: NodeId) -> bool {
    let mut stack = vec![parent_node];
    while let Some(id) = stack.pop() {
        let tree = rdom.tree_ref();
        let mut children = tree.children_ids(id);
        drop(tree);
        if children.contains(&node) {
            return true;
        }

        if rdom.contains(id) {
            children.reverse();
            stack.extend(children.iter());
        }
    }

    false
}