Trait gdnative_bindings_lily::utils::NodeExt [−][src]
pub trait NodeExt { unsafe fn get_node_as<'a, T>(&self, path: &str) -> Option<TRef<'a, T>>
where
T: SubClass<Node>; unsafe fn get_node_as_instance<'a, T>(
&self,
path: &str
) -> Option<RefInstance<'a, T, Shared>>
where
T: NativeClass,
T::Base: SubClass<Node>, { ... } }
Required methods
Convenience method to obtain a reference to a node at path
relative to self
,
and cast it to the desired type. Returns None
if the node does not exist or is
not of the correct type.
Safety
This method accesses the scene tree. As a result, any calls to this function must
follow the official thread-safety guidelines. assume_safe
invariants must be observed for the resulting node during 'a
, if any.
Provided methods
unsafe fn get_node_as_instance<'a, T>(
&self,
path: &str
) -> Option<RefInstance<'a, T, Shared>> where
T: NativeClass,
T::Base: SubClass<Node>,
unsafe fn get_node_as_instance<'a, T>(
&self,
path: &str
) -> Option<RefInstance<'a, T, Shared>> where
T: NativeClass,
T::Base: SubClass<Node>,
Convenience method to obtain a reference to a node at path
relative to self
,
and cast it to an instance of the desired NativeClass
type. Returns None
if
the node does not exist or is not of the correct type.
Safety
This method accesses the scene tree. As a result, any calls to this function must
follow the official thread-safety guidelines. assume_safe
invariants must be observed for the resulting node during 'a
, if any.