/// Decodes and returns the next raw SPIR-V word.
Decodes and returns the next raw SPIR-V word.
Decodes and returns the next raw SPIR - V word .
pub fn word(&mut self) -> Result<spirv::Word> {
        if self.has_limit() {
            if self.limit_reached() {
                return Err(Error::LimitReached(self.offset));
            } else {
                *self.limit.as_mut().unwrap() -= 1
            }
        }
        if self.offset >= self.bytes.len() || self.offset + WORD_NUM_BYTES > self.bytes.len() {
            Err(Error::StreamExpected(self.offset))
        } else {
            self.offset += WORD_NUM_BYTES;
            Ok(spirv::Word::from_le_bytes(
                self.bytes[self.offset - 4..self.offset].try_into().unwrap(),
            ))
        }
    }
pub fn word ( & mut self ) -> Result < spirv :: Word > { if self . has_limit ( ) { if self . limit_reached ( ) { return Err ( Error :: LimitReached ( self . offset ) ) ; } else { * self . limit . as_mut ( ) . unwrap ( ) -= 1 } } if self . offset >= self . bytes . len ( ) || self . offset + WORD_NUM_BYTES > self . bytes . len ( ) { Err ( Error :: StreamExpected ( self . offset ) ) } else { self . offset += WORD_NUM_BYTES ; Ok ( spirv :: Word :: from_le_bytes ( self . bytes [ self . offset - 4 .. self . offset ] . try_into ( ) . unwrap ( ) , ) ) } }
Decodes and returns the next raw SPIR-V word.
Decodes and returns the next raw SPIR - V word .
&mut self