luau-bytecode 0.732.0

Luau bytecode model, builder, serializer, and dumper
Documentation
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BytecodeReadError {
    ErrorBytecode {
        message: Vec<u8>,
    },
    UnexpectedEof {
        offset: usize,
        requested: usize,
        available: usize,
    },
    InvalidVersion {
        version: u8,
    },
    InvalidTypeVersion {
        version: u8,
    },
    InvalidTypeInfo {
        offset: usize,
    },
    InvalidDebugInfo {
        offset: usize,
    },
    InvalidOpcode {
        opcode: u8,
        offset: usize,
    },
    InvalidConstantTag {
        tag: u8,
        offset: usize,
    },
    InvalidFeedbackSlotKind {
        kind: u8,
        offset: usize,
    },
    InvalidStringId {
        id: u32,
    },
    InvalidFunctionId {
        id: u32,
    },
    FunctionGraphTooLarge {
        blocks: usize,
    },
    MissingRegisterProducer {
        block: usize,
        register: u8,
    },
}

impl BytecodeReadError {
    pub fn error_bytecode_message(&self) -> Option<&[u8]> {
        match self {
            Self::ErrorBytecode { message } => Some(message),
            _ => None,
        }
    }
}