Struct ResourceMap

Source
pub struct ResourceMap<'a> { /* private fields */ }
Expand description

Maps [virtual resources] to physical resources.

Implementations§

Source§

impl<'a> ResourceMap<'a>

Source

pub fn new( executable: &'a ExecutableTaskGraph<impl ?Sized>, ) -> Result<Self, InvalidSlotError>

Creates a new ResourceMap mapping the virtual resources of the given executable.

Source

pub fn insert_buffer( &mut self, virtual_id: Id<Buffer>, physical_id: Id<Buffer>, ) -> Result<(), InvalidSlotError>

Inserts a mapping from the [virtual buffer resource] corresponding to virtual_id to the physical resource corresponding to physical_id.

§Panics
  • Panics if the physical resource doesn’t match the virtual resource.
  • Panics if the physical resource already has a mapping from another virtual resource.
Source

pub unsafe fn insert_buffer_unchecked( &mut self, virtual_id: Id<Buffer>, physical_id: Id<Buffer>, )

Inserts a mapping from the [virtual buffer resource] corresponding to virtual_id to the physical resource corresponding to physical_id without doing any checks.

§Safety
  • virtual_id must be a valid virtual resource ID.
  • physical_id must be a valid physical resource ID.
  • The physical resource must match the virtual resource.
  • The physical resource must not have a mapping from another virtual resource.
Source

pub fn insert_image( &mut self, virtual_id: Id<Image>, physical_id: Id<Image>, ) -> Result<(), InvalidSlotError>

Inserts a mapping from the [virtual image resource] corresponding to virtual_id to the physical resource corresponding to physical_id.

§Panics
  • Panics if the physical resource doesn’t match the virtual resource.
  • Panics if the physical resource already has a mapping from another virtual resource.
  • Panics if virtual_id refers to a swapchain image.
Source

pub unsafe fn insert_image_unchecked( &mut self, virtual_id: Id<Image>, physical_id: Id<Image>, )

Inserts a mapping from the [virtual image resource] corresponding to virtual_id to the physical resource corresponding to physical_id without doing any checks.

§Safety
  • virtual_id must be a valid virtual resource ID.
  • physical_id must be a valid physical resource ID.
  • The physical resource must match the virtual resource.
  • The physical resource must not have a mapping from another virtual resource.
Source

pub fn insert_swapchain( &mut self, virtual_id: Id<Swapchain>, physical_id: Id<Swapchain>, ) -> Result<(), InvalidSlotError>

Inserts a mapping from the [virtual swapchain resource] corresponding to virtual_id to the physical resource corresponding to physical_id.

§Panics
  • Panics if the physical resource doesn’t match the virtual resource.
  • Panics if the physical resource already has a mapping from another virtual resource.
Source

pub unsafe fn insert_swapchain_unchecked( &mut self, virtual_id: Id<Swapchain>, physical_id: Id<Swapchain>, )

Inserts a mapping from the [virtual swapchain resource] corresponding to virtual_id to the physical resource corresponding to physical_id without doing any checks.

§Safety
  • virtual_id must be a valid virtual resource ID.
  • physical_id must be a valid physical resource ID.
  • The physical resource must match the virtual resource.
  • The physical resource must not have a mapping from another virtual resource.
Source

pub fn resources(&self) -> &Arc<Resources>

Returns the Resources collection.

Source

pub fn len(&self) -> u32

Returns the number of mappings in the map.

Source

pub fn is_exhaustive(&self) -> bool

Returns true if the map maps every virtual resource.

Trait Implementations§

Source§

impl DeviceOwned for ResourceMap<'_>

Source§

fn device(&self) -> &Arc<Device>

Returns the device that owns self.

Auto Trait Implementations§

§

impl<'a> Freeze for ResourceMap<'a>

§

impl<'a> !RefUnwindSafe for ResourceMap<'a>

§

impl<'a> !Send for ResourceMap<'a>

§

impl<'a> !Sync for ResourceMap<'a>

§

impl<'a> Unpin for ResourceMap<'a>

§

impl<'a> !UnwindSafe for ResourceMap<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.