pub struct Storage<T> { /* private fields */ }
Expand description
A structure holding some kind of SPIR-V entity (e.g., type, constant, instruction, etc.) that can be referenced.
Implementations§
source§impl<T> Storage<T>
impl<T> Storage<T>
pub fn new() -> Self
sourcepub fn append(&mut self, value: T) -> Token<T>
pub fn append(&mut self, value: T) -> Token<T>
Adds a new value to the storage, returning a typed token.
The value is not linked to any SPIR-V module.
sourcepub fn fetch_or_append(&mut self, value: T) -> Token<T>where
T: PartialEq,
pub fn fetch_or_append(&mut self, value: T) -> Token<T>where T: PartialEq,
Adds a value with a check for uniqueness: returns a token pointing to an existing element if its value matches the given one, or adds a new element otherwise.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for Storage<T>where T: RefUnwindSafe,
impl<T> Send for Storage<T>where T: Send,
impl<T> Sync for Storage<T>where T: Sync,
impl<T> Unpin for Storage<T>where T: Unpin,
impl<T> UnwindSafe for Storage<T>where T: UnwindSafe,
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