Struct fyrox_resource::graph::ResourceDependencyGraph
source · pub struct ResourceDependencyGraph {
pub root: ResourceGraphNode,
}
Expand description
Resource dependency graph allows you to collect all dependencies of a resource in structured form. Internally, it uses reflection to look into resources content and find dependent resources. An example of dependent resource is very simple: if you have a 3D model, then it most likely has a bunch of textures - these textures are dependent resources. A more complex example - a game level could depend on lots of prefabs, which in their turn may depend on other prefabs, textures, sounds, etc.
Fields§
§root: ResourceGraphNode
Root node of the graph.
Implementations§
source§impl ResourceDependencyGraph
impl ResourceDependencyGraph
sourcepub fn new(resource: &UntypedResource) -> Self
pub fn new(resource: &UntypedResource) -> Self
Creates a new resource dependency graph starting from a given untyped resource.
sourcepub fn for_each<F: FnMut(&UntypedResource)>(&self, func: F)
pub fn for_each<F: FnMut(&UntypedResource)>(&self, func: F)
Iterates over each dependency graph node and applying the specific function to them.
sourcepub fn pretty_print(&self) -> String
pub fn pretty_print(&self) -> String
Prints the entire dependency graph into a string.
Auto Trait Implementations§
impl Freeze for ResourceDependencyGraph
impl !RefUnwindSafe for ResourceDependencyGraph
impl Send for ResourceDependencyGraph
impl Sync for ResourceDependencyGraph
impl Unpin for ResourceDependencyGraph
impl !UnwindSafe for ResourceDependencyGraph
Blanket Implementations§
source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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
source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.