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: ResourceGraphNodeRoot 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 UnsafeUnpin 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, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
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.