Trait gdrust::unsafe_functions::node_ext::NodeExt[][src]

pub trait NodeExt {
    fn expect_node<T: SubClass<Node>, P: Into<NodePath>>(
        &self,
        path: P
    ) -> TRef<'_, T>;
fn expect_parent<T: SubClass<Node>>(&self) -> TRef<'_, T>;
fn expect_tree(&self) -> TRef<'_, SceneTree>; }

Required methods

fn expect_node<T: SubClass<Node>, P: Into<NodePath>>(
    &self,
    path: P
) -> TRef<'_, T>
[src]

Gets a typed node from a node path. This has an explicit unsafe block, and can panic. The unsafe code is calling assume_safe on the node at path.

Panics

  • If no node is found at the path.
  • If a node is found at the path, but is not the correct type.

GdScript equivalent

get_node(path)

fn expect_parent<T: SubClass<Node>>(&self) -> TRef<'_, T>[src]

Gets the parent node with a type. This has an explicit unsafe block, and can panic. The unsafe code is calling assume_safe on the parent node.

Panics

  • If no parent is found (root node).
  • If a node is found at the path, but is not the correct type.

GdScript equivalent

get_parent()

fn expect_tree(&self) -> TRef<'_, SceneTree>[src]

Gets the scene tree. This has an explicit unsafe block, and can panic. The unsafe code is calling assume_safe on the scene tree.

Panics

  • If the scene tree is not found.

GdScript Equivalent

get_tree()
Loading content...

Implementations on Foreign Types

impl<'a, T: SubClass<Node>> NodeExt for TRef<'a, T>[src]

Loading content...

Implementors

Loading content...