Enum naga::proc::index::GuardedIndex
source · pub enum GuardedIndex {
Known(u32),
Expression(Handle<Expression>),
}
Expand description
An index that may be statically known, or may need to be computed at runtime.
This enum lets us handle both Access
and AccessIndex
expressions
with the same code.
Variants§
Known(u32)
Expression(Handle<Expression>)
Implementations§
source§impl GuardedIndex
impl GuardedIndex
sourcepub(crate) fn try_resolve_to_constant(
&mut self,
expressions: &Arena<Expression>,
module: &Module,
)
pub(crate) fn try_resolve_to_constant( &mut self, expressions: &Arena<Expression>, module: &Module, )
Make a GuardedIndex::Known
from a GuardedIndex::Expression
if possible.
Return values that are already Known
unchanged.
pub(crate) fn from_expression( expr: Handle<Expression>, expressions: &Arena<Expression>, module: &Module, ) -> Self
Trait Implementations§
source§impl Clone for GuardedIndex
impl Clone for GuardedIndex
source§fn clone(&self) -> GuardedIndex
fn clone(&self) -> GuardedIndex
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for GuardedIndex
impl Debug for GuardedIndex
impl Copy for GuardedIndex
Auto Trait Implementations§
impl Freeze for GuardedIndex
impl RefUnwindSafe for GuardedIndex
impl Send for GuardedIndex
impl Sync for GuardedIndex
impl Unpin for GuardedIndex
impl UnwindSafe for GuardedIndex
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