pub struct ResourceTable { /* private fields */ }Expand description
Bookkeeping structure used while constructing a render graph. Maps logical resource names to handles and descriptors.
Implementations§
Source§impl ResourceTable
impl ResourceTable
pub fn new() -> Self
Sourcepub fn declare_transient(
&mut self,
descriptor: ResourceDescriptor,
) -> ResourceHandle
pub fn declare_transient( &mut self, descriptor: ResourceDescriptor, ) -> ResourceHandle
Declare a transient resource.
Sourcepub fn declare_imported(
&mut self,
descriptor: ResourceDescriptor,
) -> ResourceHandle
pub fn declare_imported( &mut self, descriptor: ResourceDescriptor, ) -> ResourceHandle
Declare an imported resource.
Sourcepub fn add_writer(&mut self, handle: ResourceHandle, pass_name: &str)
pub fn add_writer(&mut self, handle: ResourceHandle, pass_name: &str)
Record that a pass writes to a resource.
Sourcepub fn add_reader(&mut self, handle: ResourceHandle, pass_name: &str)
pub fn add_reader(&mut self, handle: ResourceHandle, pass_name: &str)
Record that a pass reads from a resource.
Sourcepub fn lookup(&self, name: &str) -> Option<ResourceHandle>
pub fn lookup(&self, name: &str) -> Option<ResourceHandle>
Look up a resource by name.
Sourcepub fn entry(&self, handle: ResourceHandle) -> Option<&ResourceTableEntry>
pub fn entry(&self, handle: ResourceHandle) -> Option<&ResourceTableEntry>
Get entry by handle.
Sourcepub fn entries(&self) -> &[ResourceTableEntry]
pub fn entries(&self) -> &[ResourceTableEntry]
Iterate all entries.
Sourcepub fn find_dangling(&self) -> Vec<DanglingResource>
pub fn find_dangling(&self) -> Vec<DanglingResource>
Find dangling resources: declared but never written or never read.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResourceTable
impl RefUnwindSafe for ResourceTable
impl Send for ResourceTable
impl Sync for ResourceTable
impl Unpin for ResourceTable
impl UnsafeUnpin for ResourceTable
impl UnwindSafe for ResourceTable
Blanket Implementations§
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.