pub struct Module<'a> { /* private fields */ }Expand description
Represents a SPIR-V module.
Implementations§
Source§impl<'a> Module<'a>
impl<'a> Module<'a>
Sourcepub fn new(spirv: &'a [u32]) -> ParseResult<Self>
pub fn new(spirv: &'a [u32]) -> ParseResult<Self>
Creates a new module from SPIR-V words.
Sourcepub fn parse_next(&mut self) -> ParseResult<bool>
pub fn parse_next(&mut self) -> ParseResult<bool>
Tries to parse the next instruction.
Sourcepub fn parse_full(&mut self) -> ParseResult<()>
pub fn parse_full(&mut self) -> ParseResult<()>
Tries to parse until the end of the inner Stream.
Sourcepub fn all_instructions(&self) -> impl Iterator<Item = InstructionStream<'a>>
pub fn all_instructions(&self) -> impl Iterator<Item = InstructionStream<'a>>
Returns an iterator over all instruction streams.
Sourcepub fn remaining_instructions(
&self,
) -> impl Iterator<Item = InstructionStream<'a>>
pub fn remaining_instructions( &self, ) -> impl Iterator<Item = InstructionStream<'a>>
Returns an iterator over all remaining unparsed instruction streams.
Sourcepub fn results(&self) -> impl Iterator<Item = (IdRef, InstructionStream<'a>)>
pub fn results(&self) -> impl Iterator<Item = (IdRef, InstructionStream<'a>)>
Returns an iterator over all cached instruction streams with a result.
Sourcepub fn get_result(&self, id: IdRef) -> Option<InstructionStream<'a>>
pub fn get_result(&self, id: IdRef) -> Option<InstructionStream<'a>>
Gets a result with id, returning None if the result is not present.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Module<'a>
impl<'a> RefUnwindSafe for Module<'a>
impl<'a> Send for Module<'a>
impl<'a> Sync for Module<'a>
impl<'a> Unpin for Module<'a>
impl<'a> UnsafeUnpin for Module<'a>
impl<'a> UnwindSafe for Module<'a>
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