pub struct BytecodeLoaderBuilder<R> { /* private fields */ }
Expand description
A builder for a BytecodeLoader.
Implementations§
Source§impl<R: Read> BytecodeLoaderBuilder<R>
impl<R: Read> BytecodeLoaderBuilder<R>
Sourcepub fn new(reader: R) -> Self
pub fn new(reader: R) -> Self
Creates a new BytecodeLoaderBuilder.
§Arguments
reader
: The reader to read the bytecode from.
§Returns
- A new
BytecodeLoaderBuilder
instance.
§Example
use gbf_core::bytecode_loader::BytecodeLoaderBuilder;
let reader = std::io::Cursor::new(vec![0x00, 0x00, 0x00, 0x00]);
let builder = BytecodeLoaderBuilder::new(reader);
Sourcepub fn build(self) -> Result<BytecodeLoader<R>, BytecodeLoaderError>
pub fn build(self) -> Result<BytecodeLoader<R>, BytecodeLoaderError>
Builds a BytecodeLoader
from the builder.
§Returns
- A
Result
containing theBytecodeLoader
if successful.
§Errors
BytecodeLoaderError::InvalidSectionType
if an invalid section type is encountered.BytecodeLoaderError::InvalidSectionLength
if an invalid section length is encountered.BytecodeLoaderError::StringIndexOutOfBounds
if a string index is out of bounds.BytecodeLoaderError::NoPreviousInstruction
if there is no previous instruction when setting an operand.BytecodeLoaderError::GraalIo
if an I/O error occurs.BytecodeLoaderError::OpcodeError
if an invalid opcode is encountered.
Auto Trait Implementations§
impl<R> Freeze for BytecodeLoaderBuilder<R>where
R: Freeze,
impl<R> RefUnwindSafe for BytecodeLoaderBuilder<R>where
R: RefUnwindSafe,
impl<R> Send for BytecodeLoaderBuilder<R>where
R: Send,
impl<R> Sync for BytecodeLoaderBuilder<R>where
R: Sync,
impl<R> Unpin for BytecodeLoaderBuilder<R>where
R: Unpin,
impl<R> UnwindSafe for BytecodeLoaderBuilder<R>where
R: 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